grundlagen puppet
TRANSCRIPT
Wir nutzen Technologien, um unsere Kunden glücklich zu machen. Und uns selbst.
Operations BrownbagPuppet 101
Felix Rehfeldt
inovex GmbH
System Engineer
Agenda:
● Was ist Puppet
● Was ist Puppet nicht
● Setup Puppet
● File organisation
● Node definitions
● Der Client run
...was machen wir hier eigentlich
09.03.12 2
09.03.12
Was ist Puppet
Tool für Configuration Management • geschrieben in Ruby
• eigene Sprache für Manifests (ralsh)
• Kommunikation via XMLRPC over HTTP
Automatisierung von Tasks• Installation und Management von Paketen
• Anlegen und Verwalten von Benutzer/Gruppen/Permissions
• Verteilen und Management von Files und Services
Facter als Schnittstelle zum System • Auslesen von Systemvariablen (lsb, IP's, uvm.)
• Kann Variablen über die gesammelten Systeminformationen setzen
09.03.12
Was ist Puppet nicht
• Puppet ist kein System dass out of the box dass macht was wir wollen! Es ist ein umfangreiches Framework welches einen recht hohen initialen Konfigurationsaufwand mit sich bringt.
• Puppet nimmt es einem nicht ab das zu managende System zu verstehen. Wer nicht weiß wie ein System zu bedienen ist, sollte Puppet zunächst außen vor lassen.
09.03.12
Setup Puppet
Die Puppet Installation
• apt-get install puppetmaster! Leider nicht...
• Nach der Standardinstallation läuft der Puppetmaster mit einem Ruby webrick HTTP server
• was wir wollen..
• Ruby EE
• Apache2
• Phusion Passenger (mod_rails | mod_rack)
• Puppetmaster
09.03.12
Setup Puppet
Die erste Konfiguration
sandwichmaker:puppet felix$ vi fileserver.conf
...
[files]
172.26.26.0/24
…
sandwichmaker:puppet felix$ vi puppet.conf
...
[master]
ssl_client_header = SSL_CLIENT_S_DN
ssl_client_verify_header = SSL_CLIENT_VERIFY
certname=puppetmaster.foo.org
modulepath=/etc/puppet/modules
...
09.03.12
File organisation
Die Puppet module Struktur
sandwichmaker:testmodul root# tree
.
├── files
...
├── manifests
...
├── plugins
│ └── puppet
│ └── parser
│ └── functions
...
└── templates
...
09.03.12
File organisation
Eine manifest Struktur
sandwichmaker:manifests root# tree -L 2
.
├── integration
│ ├── basenodes
│ ├── nodes-available
│ └── nodes-enabled
├── prelive
│ ├── basenodes
│ ├── nodes-available
│ └── nodes-enabled
├── production
│ ├── basenodes
│ ├── nodes-available
│ └── nodes-enabled
└── site.pp
09.03.12
Node definitions
plain text nodes node default {
include common
}
node /ftp\d+/ inherits default {
include ftp-module
}
node ftp01.bar.com inherits default {
$network_config = {
eth0 => {
ipadd => "172.26.26.11",
networkmask => "255.255.255.0",
gateway => "172.26.26.1"
}
}
include ftp-module
include network
}
09.03.12
Node definitions
LDAP Nodes
zusätzliche Konfiguration
• puppet.conf
[master]
node_terminus = ldap
ldapserver = foo.bar.com
ldapbase = ou=hosts,dc=bar,dc=com
Nodes hinzufügen und editieren
# ldapvi --add -o top -o device -o puppetClient -b cn=base,ou=hosts,cn=bar,cn=com
09.03.12
Node definitions
External Nodes
zusätzliche Konfiguration
• puppet.conf
[master]
node_terminus = exec
external_nodes = /path/to/script.rb
Nodes hinzufügen und editieren
...
09.03.12
Der Client run… fast geschafft
Client Modi:• Daemon Mode
• Listen Mode
• Singletime run
Was macht puppet wann:• Wann passiert was
• before und require
• Was können wir machen wenn before und require nicht reichen
Bugs & Co
Wir nutzen Technologien, um unsere Kunden glücklich zu machen. Und uns selbst.
inovex GmbH
PforzheimKarlsruher Straße 71D-75179 Pforzheim
MünchenValentin-Linhof-Str. 2D-81829 München
KölnKaiser-Wilhelm-Ring 27-29D-50672 Köln
Vielen Dank für Ihre Aufmerksamkeit!