Top Banner
Workshop Puppet Walter Heck Sascha Greven
12
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Workshop puppet (dev opsdays ams 2015)

Workshop PuppetWalter HeckSascha Greven

Page 2: Workshop puppet (dev opsdays ams 2015)

●●●●●●●●

Page 3: Workshop puppet (dev opsdays ams 2015)

Who are we and who are you?

Walter Heck● Founder and CTO @

OlinData● Certified Puppet

Professional● Certified Puppet

Instructor● Father, geek, traveler

Sascha Greven● Freelance systems

engineer @ OlinData● Cloud consultant● Technical engineer● Dancer:

Page 4: Workshop puppet (dev opsdays ams 2015)

Who is this workshop for?

● Building a LAMP stack with Puppet -> Simple WordPress instance on a single host

● Beginners with Puppet

● Follow along on your own laptop or look over someone else’s shoulder

Page 5: Workshop puppet (dev opsdays ams 2015)

Architecture of a Puppet Setup

Puppet Agent● (usually) initiates

puppet run● gathers facts about

the node● compares the catalog

from the master to the local machine

Puppet Master● holds puppet code● compiles code into a catalog

for each node● processes reports● functions as Certificate

Authority● stores information about

nodes in PuppetDB● technically optional but

highly recommended

Page 6: Workshop puppet (dev opsdays ams 2015)

Lifecycle of a Puppet runagent (or mcollective) starts puppet runagent authenticates with master over SSLif it’s authorized to run it gets a list of facts it needs to gatherfacts are gathered by the agent and sent to the mastermaster parses puppet code and compiles a catalog with all resources and their required state for the node. This includes correct ordering.agent receives catalog from masteragent compares all resources in the catalog to the state of the resource on the node itself and makes changes where neededagent keeps a report of all resources in the catalog and their state, sends the report back to the mastermaster parses report and sends it to destination (disk, central logs, elasticsearch, irc, hipchat, etc.)

Page 7: Workshop puppet (dev opsdays ams 2015)

Setting up puppet

set up DNS, NTPdinstall puppetmaster

yum install puppet-serverinstall agent

yum install puppetrun ’puppet agent -t’ to create agent cert and create certificate signing request

5. sign the certificate on the masterpuppet cert list puppet cert sign --all

Page 8: Workshop puppet (dev opsdays ams 2015)

Create a puppet repo

● root of your repo will be in /etc/puppetlabs/puppet/environments/production

● install the needed puppet modules○ puppet module install puppetlabs-apache

hunner-wordpress puppetlabs-mysql● create a node block in site.pp

○ node ‘training.puppetlabs.vm’ {

fail(‘write code here’)

}

● check documentation on http://forge.puppetlabs.com and decide which resources you need

Page 9: Workshop puppet (dev opsdays ams 2015)

Run Puppet

Dry run: puppet agent -t --noopNormal run: puppet agent -t

Page 10: Workshop puppet (dev opsdays ams 2015)

Next steps

● use a dashboard ○ puppet enterprise console○ the foreman/sattelite○ puppet explorer

● use an IDE○ gepetto, sublime text

● externalise configuration data to hiera○ hiera-eyaml, hiera-gpg, hiera-vault(?)

● split up mysql and apache to multiple nodes○ create haProxy instance to load balance http traffic

● create more than one virtual host● use roles and profiles● exported resources

Page 12: Workshop puppet (dev opsdays ams 2015)

http://bit.ly/olindata-galera-migration