Slide 1

Slide 1 text

Introduction Installation Configuration References Puppet: Configuration management tool Master on Free Software 2011-2012 Jose Castro http://gsyc.urjc.es/~jfcastro [email protected] @jfcastroluis 24 de noviembre de 2011 1 / 22 Jose Castro Puppet: Configuration management tool

Slide 2

Slide 2 text

Introduction Installation Configuration References c 2011 Jose Castro This work is licensed under a Creative Commons Attribution 3.0 License http://creativecommons.org/licenses/by/3.0 2 / 22 Jose Castro Puppet: Configuration management tool

Slide 3

Slide 3 text

Introduction Installation Configuration References Context Overview Components Table of Contents 1 Introduction Context Overview Components 2 Installation Packages install Master config Agent connection 3 Configuration Node definition Resource definition Module definition Even more 4 References 3 / 22 Jose Castro Puppet: Configuration management tool

Slide 4

Slide 4 text

Introduction Installation Configuration References Context Overview Components Context Sysadmins tasks are often repetitive: deploying hosts creating users managing applications configuring daemons monitoring services ... We are always trying automating them with scripts but become complex poorly documented customized to each enviroment rarely scale to large platforms “ssh in a for loop is not a solution” — Luke Kanies, Puppet devel 4 / 22 Jose Castro Puppet: Configuration management tool

Slide 5

Slide 5 text

Introduction Installation Configuration References Context Overview Components Overview Puppet is a configuration management framework and tools with an object-oriented model Ruby-based GPLv2 and Apache (for 2.7.0 and later) Luke Kanies began developing tool in 2001 In 2005 he founded PuppetLabs 0.25.5 to 2.6.0 version Linux, FreeBSD, OpenBSD, Solaris, AIX, HP UX, MacOS... 5 / 22 Jose Castro Puppet: Configuration management tool

Slide 6

Slide 6 text

Introduction Installation Configuration References Context Overview Components Components (I) Deployment Configuration language and resource abstraction layer Transactional layer 6 / 22 Jose Castro Puppet: Configuration management tool

Slide 7

Slide 7 text

Introduction Installation Configuration References Context Overview Components Components (II) Deployment master agent agent agent ... master runs a daemon listens on port 8140 serves a configuration catalog agents connect to master via SSL connection retrieve any configuration from catalog can run as daemon or manually triggered Puppet can also run in a stand-alone mode 7 / 22 Jose Castro Puppet: Configuration management tool

Slide 8

Slide 8 text

Introduction Installation Configuration References Context Overview Components Components (III) Configuration language and resource abstraction layer Package example package { ’vim’: provider => apt, ensure => present, } configuration items are named resources statements about the state of configuration sysadmin doesn’t care how this state is achieved agents use Facter to get information about themself agents manage providers depending on system type 8 / 22 Jose Castro Puppet: Configuration management tool

Slide 9

Slide 9 text

Introduction Installation Configuration References Context Overview Components Components (and IV) Transactional layer The process of host configuration has these steps: Compile the configuration Transfer the compiled configuration to agents Apply the configuration on agents Report the results to the master 9 / 22 Jose Castro Puppet: Configuration management tool

Slide 10

Slide 10 text

Introduction Installation Configuration References Packages install Master config Agent connection Table of Contents 1 Introduction Context Overview Components 2 Installation Packages install Master config Agent connection 3 Configuration Node definition Resource definition Module definition Even more 4 References 10 / 22 Jose Castro Puppet: Configuration management tool

Slide 11

Slide 11 text

Introduction Installation Configuration References Packages install Master config Agent connection Packages install Debian and Ubuntu: # apt-get install puppetmaster facter # apt-get install puppet facter Red Hat: # yum install puppet-server facter # yum install puppet facter FreeBSD: # pkg add -r puppet OpenSolaris: # pkg install -q SUNWruby18 # gem install puppet facter 11 / 22 Jose Castro Puppet: Configuration management tool

Slide 12

Slide 12 text

Introduction Installation Configuration References Packages install Master config Agent connection Master config /etc/puppet/puppet.conf [master] certname=puppet.example.com /etc/hosts x.x.x.x puppet.example.com puppet /etc/puppet/manifests/site.pp # mkdir /etc/puppet/manifests # touch /etc/puppet/manifests/site.pp 12 / 22 Jose Castro Puppet: Configuration management tool

Slide 13

Slide 13 text

Introduction Installation Configuration References Packages install Master config Agent connection Master running Daemon # service puppetmaster start Process # puppet master –no-daemonize initiates Puppet environments creates a local Certificate Authority creates cretificates and keys for master open a connection waiting for clients 13 / 22 Jose Castro Puppet: Configuration management tool

Slide 14

Slide 14 text

Introduction Installation Configuration References Packages install Master config Agent connection Agent connection Agent running # puppet agent –server=puppet.example.com –no-daemonize –verbose Master signing # puppet cert –list # puppet cert –sign node1.example.com 14 / 22 Jose Castro Puppet: Configuration management tool

Slide 15

Slide 15 text

Introduction Installation Configuration References Node definition Resource definition Module definition Even more Table of Contents 1 Introduction Context Overview Components 2 Installation Packages install Master config Agent connection 3 Configuration Node definition Resource definition Module definition Even more 4 References 15 / 22 Jose Castro Puppet: Configuration management tool

Slide 16

Slide 16 text

Introduction Installation Configuration References Node definition Resource definition Module definition Even more Node definition site.pp import ’nodes.pp’ $puppetserver = ’puppet.example.com’ nodes.pp node ’node1.example.com’ { include sudo package { ’vim’: ensure => present } } There are two types of collection we can include in a node: Classes – a basic collection of resources Modules – an advanced and portable collection of resources 16 / 22 Jose Castro Puppet: Configuration management tool

Slide 17

Slide 17 text

Introduction Installation Configuration References Node definition Resource definition Module definition Even more Resource definition Resource type { title: attribute => value, } 17 / 22 Jose Castro Puppet: Configuration management tool

Slide 18

Slide 18 text

Introduction Installation Configuration References Node definition Resource definition Module definition Even more Module definition Module structure # mkdir -p /etc/puppet/modules/sudo/{manifests,files,templates} # touch /etc/puppet/modules/sudo/manifest/init.pp manifests – configuration files files – files to send to nodes templates – templates to generate files 18 / 22 Jose Castro Puppet: Configuration management tool

Slide 19

Slide 19 text

Introduction Installation Configuration References Node definition Resource definition Module definition Even more Even more Templates Inheritance Environments Scheduling SCM to manage modules 19 / 22 Jose Castro Puppet: Configuration management tool

Slide 20

Slide 20 text

Introduction Installation Configuration References Table of Contents 1 Introduction Context Overview Components 2 Installation Packages install Master config Agent connection 3 Configuration Node definition Resource definition Module definition Even more 4 References 20 / 22 Jose Castro Puppet: Configuration management tool

Slide 21

Slide 21 text

Introduction Installation Configuration References References Books Pro Puppet (James Turnbull and Jeffrey McCune) – APress Management Infraestructures with Puppet (James Loope) – O’Reilly Puppet 2.7 Cookbook (John Arundel) – Packt Online Doc http://docs.puppetlabs.com http://www.puppetcookbook.com More #puppet on Freenode http://groups.google.com/group/puppet-users 21 / 22 Jose Castro Puppet: Configuration management tool

Slide 22

Slide 22 text

Introduction Installation Configuration References Puppet: Configuration management tool Master on Free Software 2011-2012 Jose Castro http://gsyc.urjc.es/~jfcastro [email protected] @jfcastroluis 24 de noviembre de 2011 22 / 22 Jose Castro Puppet: Configuration management tool