An Introduction to Puppet Enterprise

Similar documents
SCaLE Puppet Introduction. Puppet Assigns and Maintains a Machine s Desired Role

a. puppet should point to master (i.e., append puppet to line with master in it. Use a text editor like Vim.

Integrating the Cloud with Puppet. Tuesday, February 26, 13

Deploying Rubrik Datos IO to Protect MongoDB Database on GCP

Configuration Management - Using Puppet. lctseng / Liang-Chi Tseng

Check the FQDN of your server by executing following two commands in the terminal.

202 Lab Introduction Connecting to the Lab Environment

If you had a freshly generated image from an LCI instructor, make sure to set the hostnames again:

Configuration Management with Puppet. Introduction

Table of Contents HOL-PRT-1469

Lab 1: Accessing the Linux Operating System Spring 2009

Linux Operating System Environment Computadors Grau en Ciència i Enginyeria de Dades Q2

Red Hat Satellite 6.3

Hands-on Exercise Hadoop

Jackson State University Department of Computer Science CSC / Computer Security Fall 2013 Instructor: Dr. Natarajan Meghanathan

Red Hat Satellite 6.2

How to Use This Lab Manual

Redhat OpenStack 5.0 and PLUMgrid OpenStack Networking Suite 2.0 Installation Hands-on lab guide

Being a puppet master

Configure HOSTNAME by adding the hostname to the file /etc/sysconfig/network. Do the same to all the all nodes.

Active System Manager Release 8.2 SDK Reference Guide

Commands are in black

Configure HOSTNAME by adding the hostname to the file /etc/sysconfig/network. Do the same to all the other 3(4) nodes.

Everything about Linux User- and Filemanagement

EX200 Q&A. DEMO Version

Symantec NetBackup Appliances Hands-On Lab

22-Sep CSCI 2132 Software Development Lecture 8: Shells, Processes, and Job Control. Faculty of Computer Science, Dalhousie University

Project #3: Implementing NIS

Puppet Labs Modules - Feature #11050 firewall: RFE that ensure could support ignore.

Contents. Note: pay attention to where you are. Note: Plaintext version. Note: pay attention to where you are... 1 Note: Plaintext version...

CIS 192 Linux Lab Exercise

Testing your puppet code

Nested Home Lab Setting up Shared Storage

Manually Change Default Gateway Centos Command Line Windows

Lab 2A> ADDING USERS in Linux

A guide to building your own Puppet module and importing it into Satellite 6 Edition 1

A guide to building your own Puppet module and importing it into Satellite 6 Edition 1. Red Hat Satellite Documentation Team

CS/CIS 249 SP18 - Intro to Information Security

Puppet on the AWS Cloud

Linux Essentials Objectives Topics:

Automating Administration with Windows PowerShell (10961)

A WEB-BASED SOLUTION TO VISUALIZE OPERATIONAL MONITORING LINUX CLUSTER FOR THE PROTODUNE DATA QUALITY MONITORING CLUSTER

Downloading and installing Db2 Developer Community Edition on Red Hat Enterprise Linux Roger E. Sanders Yujing Ke Published on October 24, 2018

Automating Administration with Windows PowerShell

15. Creating a Samba Server in Knoppix v.3

Puppet 101 Basic installation for master and agent machines on Ubuntu with VMware Workstation

CENG 334 Computer Networks. Laboratory I Linux Tutorial

bash Scripting Introduction COMP2101 Winter 2019

Network softwarization Lab session 2: OS Virtualization Networking

Lab 4: Protocols and Default Network Ports - Connecting to a Remote System

Aliases are set manually or in a login script. Aliases that were set manually will be gone the next time you login.

Introduction to Linux for BlueBEAR. January

VM Service. A Benchmark suite for cloud environment USER S MANUAL

Hosting Applications Using Configuration Management Tools

CS CS Tutorial 2 2 Winter 2018

OPERATING SYSTEMS LINUX

Downloading and installing Db2 Developer Community Edition on Ubuntu Linux Roger E. Sanders Yujing Ke Published on October 24, 2018

CS Fundamentals of Programming II Fall Very Basic UNIX

OPENSTACK CLOUD RUNNING IN A VIRTUAL MACHINE. In Preferences, add 3 Host-only Ethernet Adapters with the following IP Addresses:

More Raspian. An editor Configuration files Shell scripts Shell variables System admin

Linux at the Command Line Don Johnson of BU IS&T

CyberP3i Hands-on Lab Series

Command-Line Interface (CLI) Basics

Installing and Configuring vcloud Connector

Introduction to Lab Practicals (Lab Intro 3) Access Control, Synchronisation and Remote Access

Unix/Linux Basics. Cpt S 223, Fall 2007 Copyright: Washington State University

Chapter 1 An Introduction to C++, Unix, SSH and Komodo Edit

[MS10961]: Automating Administration with Windows PowerShell

Installation of Sybase ASE 15.5 on Solaris 10 is pretty easy to accomplish. Please, do follow the steps as below.

CSE 303 Lecture 4. users/groups; permissions; intro to shell scripting. read Linux Pocket Guide pp , 25-27, 61-65, , 176

OPS235: Week 1. Installing Linux ( Lab1: Investigations 1-4)

Oracle Grid Infrastructure RAC Provisioning - Using OEM GC 11.1

ECE 4110 Internetwork Programming Lab 4: Network Traffic Analyzers and Other Tools. Lab Goals. Section I: Ping vs. Ethereal

Oracle WebLogic Server (WLS) 11gR1 ( and ) Installation on Oracle Linux 5 and 6

Install CPS All In One on VMWare Virtual Player 12

CS 215 Fundamentals of Programming II Spring 2019 Very Basic UNIX

Lab 3a Using the vi editor

8.9.2 Lab: Configure an Ethernet NIC to use DHCP in Windows Vista

How to Restrict a Login Shell Using Linux Namespaces

EM L04 Using Workflow to Manage Your Patch Process and Follow CISSP Best Practices

User Manual op5 System 3.1

Chapter 1 An Introduction to C++, Unix, SSH and Komodo Edit

Installing Cisco VTS in a Linux - OpenStack Environment

OTN Developer Day: Oracle Big Data

Lab 4 - Network Traffic Analyzers and Other Tools

Lab 1: Introduction to Linux Networking

Product Page:

Answers to Even-numbered Exercises

John the Ripper on a Ubuntu MPI Cluster

IBM Atlas Policy Distribution Administrators Guide: IER Connector. for IBM Atlas Suite v6

Loadbalancer.org Appliance Administration v4.1.5

CST8207: GNU/Linux Operating Systems I Lab Six Linux File System Permissions. Linux File System Permissions (modes) - Part 1

CS 410/510: Web Security X1: Labs Setup WFP1, WFP2, and Kali VMs on Google Cloud

Spring 2017 Gabriel Kuri

LAN Setup Reflection. Ask yourself some questions: o Does your VM have the correct IP? o Are you able to ping some locations, internal and external?

Introduction to Lab Practicals (Lab Intro 3) Access Control, Synchronisation and Remote Access

Installing Cisco VTS on a VMware Environment, page 6 Installing the Virtual Topology Forwarder, page 9 Verifying VTS Installation, page 14

GSS Administration and Troubleshooting

: 10961C: Automating Administration With Windows PowerShell

Precursor Steps & Storage Node

Transcription:

An Introduction to Puppet Enterprise Exercise & Lab Guide Puppet Education www.puppetlabs.com/education 2013 Puppet Labs

2013 Puppet Labs

Lab 3.1: Pre-installation Objective: Assign a hostname to your agent and make that name persist across reboots Steps: Edit your system host?le 1. Log in to your virtual machine with the username "root" and password "puppet" 2. Note the system's IP address displayed; if you missed it type ifconfig eth0 Your agent's IP 3. Ask your instructor for the classroom master's IP address The master's IP 4. Ensure your VM's clock is in sync with the Puppet Master ntpdate us.pool.ntp.org 5. Choose a username for class consisting of alphanumeric characters only. It will be used throughout the course and referred to as yourname. Your username 6. Edit the system host?le and add entries for master, puppet, and yourname vim /etc/hosts Example File: append "the-masters-ip master.puppetlabs.vm master puppet" append "your-agents-ip yourname.puppetlabs.vm yourname" # Do not remove the following line, or various programs # that require network functionality will fail. 127.0.0.1 localhost.localdomain localhost ::1 localhost6.localdomain6 localhost6 192.168.X.X master.puppetlabs.vm master puppet 192.168.Y.Y yourname.puppetlabs.vm yourname continued... Intro to Puppet Enterprise 3.1.2 1 2013 Puppet Labs

Con?gure your system hostname 1. Set your hostname for the current session and to be persistent across reboots hostname yourname.puppetlabs.vm Example File: exec bash vim /etc/sysconfig/network NETWORKING=yes NETWORKING_IPV6=yes HOSTNAME=yourname.puppetlabs.vm Validate your work. 1. Use the validation script we have provided to check your work on each step above. verify_fundamentals_settings.sh yourname Expected Results: [root@yourname ~]# verify_fundamentals_settings.sh yourname Checking hostname [ OK ] Checking hostname validity [ OK ] Checking that the hostname will be set on boot [ OK ] Checking master name resolution [ OK ] Checking local hostname resolution [ OK ] Please note that later exercises will use training as the student environment name, hostname, etc. Intro to Puppet Enterprise 3.1.2 2 2013 Puppet Labs

Lab 3.2: Installation Objective: Install Puppet Enterprise on your virtual machine. Steps: Install Puppet Enterprise on the virtual machine by running the installer located in the puppet-enterprise directory. Create an answer?le for your Puppet Enterprise installation 1. Create an answer?le for your installation cd ~/puppet-enterprise/./puppet-enterprise-installer -s answers.txt Install both the agent and the master role. Press [enter] to accept most default answers. When asked for the Admin email address for accessing the console interface, use yourname@puppetlabs.vm`. When asked for the Password for user yourname@puppetlabs.vm, use puppetlabs When asked for the SMTP server to email account information to users, use yourname.puppetlabs.vm For everything else, press [enter] to accept default answers. 2. Review the answer?le that was just created and ensure there are no mistakes cat answers.txt Example File: q_install=y q_puppet_cloud_install=n q_puppet_enterpriseconsole_auth_database_name=console_auth q_puppet_enterpriseconsole_auth_database_password=v2mkgtv7bwt2lpiqictq q_puppet_enterpriseconsole_auth_database_user=console_auth q_puppet_enterpriseconsole_auth_password=puppetlabs q_puppet_enterpriseconsole_auth_user_email=yourname@puppetlabs.vm q_puppet_enterpriseconsole_database_install=y Intro to Puppet Enterprise 3.1.2 3 2013 Puppet Labs

continued... q_puppet_enterpriseconsole_database_name=console q_puppet_enterpriseconsole_database_password=iheymzukc6pngoih1dv9 q_puppet_enterpriseconsole_database_remote=n q_puppet_enterpriseconsole_database_root_password=wbt6lmykkylxkugz26e6 q_puppet_enterpriseconsole_database_user=console q_puppet_enterpriseconsole_httpd_port=443 q_puppet_enterpriseconsole_install=y q_puppet_enterpriseconsole_inventory_hostname=yourname.puppetlabs.vm q_puppet_enterpriseconsole_inventory_port=8140 q_puppet_enterpriseconsole_master_hostname=yourname.puppetlabs.vm q_puppet_enterpriseconsole_smtp_host=yourname.puppetlabs.vm q_puppet_enterpriseconsole_smtp_password= q_puppet_enterpriseconsole_smtp_port=25 q_puppet_enterpriseconsole_smtp_use_tls=n q_puppet_enterpriseconsole_smtp_user_auth=n q_puppet_enterpriseconsole_smtp_username= q_puppet_symlinks_install=y q_puppetagent_certname=yourname.puppetlabs.vm q_puppetagent_install=y q_puppetagent_server=yourname.puppetlabs.vm q_puppetca_install=y q_puppetmaster_certname=yourname.puppetlabs.vm q_puppetmaster_dnsaltnames=puppet,puppet.puppetlabs.vm,yourname,yourname.puppetlabs.v q_puppetmaster_enterpriseconsole_hostname=localhost q_puppetmaster_enterpriseconsole_port=443 q_puppetmaster_install=y q_vendor_packages_install=y q_verify_packages=y Intro to Puppet Enterprise 3.1.2 4 2013 Puppet Labs

Install Puppet Enterprise using the answer?le you created 1. Perform your installation using the answer?le you created cd ~/puppet-enterprise/./puppet-enterprise-installer -a answers.txt Explore your new Puppet Enterprise installation 1. Run: puppet -V Please note the option above is a capital V should display the puppet agent's version 2. Run: puppet agent --configprint confdir should display the puppet agent's con?guration directory /etc/puppetlabs/puppet 3. Run: puppet agent --configprint certname should display the puppet agent's certi?cate name: yourname.puppetlabs.vm 4. Run: puppet agent --configprint server should display the puppet agent's master: yourname.puppetlabs.vm Intro to Puppet Enterprise 3.1.2 5 2013 Puppet Labs

Exercise 3.3: Facter Objective: Become familiar with the use of facter Steps: 1. Execute facter ipaddress What is returned? 2. Execute facter operatingsystem What is returned? 3. Execute facter What is returned? Discussion Questions What sort of information is returned by facts? How might you use Facter outside of Puppet? Why do you think Facter exposes facts such as ipaddress_eth0 instead of a single array of values? Intro to Puppet Enterprise 3.1.2 6 2013 Puppet Labs

Exercise 3.4: Puppet Resource Objective: Use puppet resource to inspect user accounts Steps: Create a user account on your system 1. Create your user account manually with useradd useradd -s /bin/bash -b /home yourname 2. Using puppet resource, inspect your user account on the system puppet resource user yourname Note the "password =>" value Add a password to your account 1. Set your new user account password to "puppetlabs" passwd yourname 2. Using puppet resource, inspect your user account on the system puppet resource user yourname Discussion Questions Note that the "password =>" value has changed How might you inspect other resource types, such as groups or?les? Why does puppet resource return so much information? Do you think that puppet resource could list iptables rules if a resource type existed for them? Why or why not? Intro to Puppet Enterprise 3.1.2 7 2013 Puppet Labs

Lab 5.1: Build Your First Module Objective: Construct and test a Puppet Module to manage user account introduction. Steps: 1. Ensure your current working directory is the modulepath cd /etc/puppetlabs/puppet/modules 2. Create your manifests directory mkdir -p users/manifests 3. Edit your manifest vim users/manifests/init.pp 4. Use puppet parser validate to validate the syntax of your manifest puppet parser validate users/manifests/init.pp Expected result [root@training modules]# puppet parser validate users/manifests/init.pp [root@training modules]# There will be no output if the syntax of your?le is correct. Discussion Questions Will puppet parser validate tell you if you use the wrong attribute name? Will puppet parser validate tell you if you misspell the resource type? Why or why not? Intro to Puppet Enterprise 3.1.2 8 2013 Puppet Labs

Lab 5.2: Use Your Module Objective: Enforce your users class on your local agent. Steps: 1. Ensure your current working directory is the modulepath cd /root/puppetcode/modules 2. Create your tests directory mkdir users/tests 3. Create your smoke test vim users/tests/init.pp 4. Validate your syntax and simulate your smoke test puppet parser validate users/tests/init.pp puppet apply --noop users/tests/init.pp 5. Enforce your class on the local system puppet apply users/tests/init.pp Expected results [root@training modules]# puppet apply --noop users/tests/init.pp notice: /Stage[main]/Users/User[fundamentals]/ensure: current_value absent, should notice: Class[Users]: Would have triggered 'refresh' from 1 events notice: Stage[main]: Would have triggered 'refresh' from 1 events notice: Finished catalog run in 0.28 seconds [root@training modules]# puppet apply users/tests/init.pp notice: /Stage[main]/Users/User[fundamentals]/ensure: created notice: Finished catalog run in 0.37 seconds Discussion Questions What role should your smoke tests play in your complete testing strategy? What limitations do you think that --noop mode might have? Can you identify a scenario in which the --noop run could succeed but the real run would fail? Intro to Puppet Enterprise 3.1.2 9 2013 Puppet Labs

Lab 5.3: Expand Your Module Objective: Extend your module to manage multiple resource types Steps: 1. Ensure your current working directory is the modulepath cd /root/puppetcode/modules 2. Edit your manifest vim users/manifests/init.pp 3. Modify your users class to provide the following additional attributes Add a group resource to manage the "staff" group Add the "staff" group to fundamentals Add the /bin/bash shell to fundamentals 4. Validate the syntax of your class and enforce it locally puppet parser validate users/manifests/init.pp Expected results puppet apply users/tests/init.pp [root@training modules]# puppet apply users/tests/init.pp notice: /Stage[main]/Users/Group[staff]/ensure: created notice: /Stage[main]/Users/User[fundamentals]/shell: shell changed '/bin/zsh' to ' notice: Finished catalog run in 0.28 seconds Discussion Questions Why might you not see the shell change during this lab? What would happen if you used chsh to modify the user's shell and ran again? Can you set the shell to any arbitrary value? Why or why not? Intro to Puppet Enterprise 3.1.2 10 2013 Puppet Labs

Lab 5.1: Proposed Solution Build Your First Module Your module structure should resemble: [root@training modules]# tree users/ users/ manifests init.pp Example le: users/manifests/init.p class users { user { 'introduction': ensure => present, } } Intro to Puppet Enterprise 3.1.2 1 2013 Puppet Labs

Lab 5.2: Proposed solution Use Your Module Your module structure should resemble [root@training modules]# tree users/ users/ manifests init.pp tests init.pp Example le: users/tests/init.p include users Intro to Puppet Enterprise 3.1.2 2 2013 Puppet Labs

Lab 5.3: Proposed Solution Extend your module to manage multiple resource types Your module structure should resemble [root@training modules]# tree users/ users/ manifests init.pp tests init.pp Example le: users/manifests/init.p class users { user { 'fundamentals': ensure => present, gid => 'staff', shell => '/bin/bash', } } group { 'staff': ensure => present, } Intro to Puppet Enterprise 3.1.2 3 2013 Puppet Labs