Puppet: Unterschied zwischen den Versionen

Aus Xinux Wiki
Zur Navigation springen Zur Suche springen
Zeile 63: Zeile 63:
 
  root@tic:~# service puppet restart  
 
  root@tic:~# service puppet restart  
 
   * Restarting puppet agent
 
   * Restarting puppet agent
 +
kontrolle
 +
root@tac:~# ps -elf | grep puppet
 +
5 S root      2711    1  0  80  0 - 46195 futex_ 11:15 ?        00:00:00 /usr/bin/ruby /usr/bin/puppet agent
 +
0 S root      2734  1516  0  80  0 -  3313 pipe_w 11:17 pts/0    00:00:00 grep --color=auto puppet
 +
 +
root@tic:~# ps -elf | grep puppet
 +
5 S root      2551    1  0  80  0 - 46188 futex_ 11:15 ?        00:00:00 /usr/bin/ruby /usr/bin/puppet agent
 +
0 S root      2571  1517  0  80  0 -  3313 pipe_w 11:17 pts/0    00:00:00 grep --color=auto puppet
  
 
=docus=
 
=docus=

Version vom 20. Februar 2015, 10:19 Uhr

puppet grundlagen

szenario

der spätere master server "puppet"

root@puppet:~# host tac
tac.xinux.org has address 192.168.244.52
root@puppet:~# host tic
tic.xinux.org has address 192.168.244.53

der client "tac"

root@tac:~# host puppet
puppet.xinux.org has address 192.168.244.51
root@tac:~# netstat -lntp
Aktive Internetverbindungen (Nur Server)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      913/sshd        
tcp6       0      0 :::22                   :::*                    LISTEN      913/sshd

der client "tic"

root@tic:~# host puppet
puppet.xinux.org has address 192.168.244.51
root@tic:~# netstat -lntp
Aktive Internetverbindungen (Nur Server)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      916/sshd        
tcp6       0      0 :::22                   :::*                    LISTEN      916/sshd 

installation vom puppetmaster

root@puppet:~# apt-get update 
root@puppet:~# apt-get install puppetmaster -y

das konfigurationsverzeichnis

root@puppet:/etc/puppet# ls 
auth.conf  etckeeper-commit-post  etckeeper-commit-pre  files  fileserver.conf  manifests  modules  puppet.conf  templates

das standard site manifest

das verzeichnis ist leer

root@puppet:/etc/puppet# cd manifests/
root@puppet:/etc/puppet/manifests# ls

beispiel apache

root@puppet:/etc/puppet/manifests# cat site.pp
package {
       'apache2' :
               ensure => installed
}
service {
       'apache2 :
               ensure => true,
               enable => true,
               require => Package['apache2']
}

restarten des service

root@puppet:~# service puppetmaster restart
 * Restarting puppet master

installation der puppetclients

auf tac

root@tac:~# apt-get update
root@tac:~# apt-get install -y puppet

auf tic

root@tic:~# apt-get update
root@tic:~# apt-get install -y puppet

puppetd dämon starten

tac und tic

root@tac:~# service puppet restart 
 * Restarting puppet agent  
root@tic:~# service puppet restart 
 * Restarting puppet agent

kontrolle

root@tac:~# ps -elf | grep puppet
5 S root      2711     1  0  80   0 - 46195 futex_ 11:15 ?        00:00:00 /usr/bin/ruby /usr/bin/puppet agent
0 S root      2734  1516  0  80   0 -  3313 pipe_w 11:17 pts/0    00:00:00 grep --color=auto puppet
root@tic:~# ps -elf | grep puppet
5 S root      2551     1  0  80   0 - 46188 futex_ 11:15 ?        00:00:00 /usr/bin/ruby /usr/bin/puppet agent
0 S root      2571  1517  0  80   0 -  3313 pipe_w 11:17 pts/0    00:00:00 grep --color=auto puppet

docus

video