RedHat 7
Starting and stopping an agent
[root@u8v9bdrz4y5vy3s ~]# puppet resource service puppet
|
service { 'puppet':
|
ensure => 'stopped',
|
enable => 'false',
|
}
|
|
[root@u8v9bdrz4y5vy3s ~]# systemctl start puppet
|
[root@u8v9bdrz4y5vy3s ~]# systemctl status puppet
|
puppet.service - Puppet agent
|
Loaded: loaded (/usr/lib/systemd/system/puppet.service; disabled)
|
Active: active (running) since Thu 2015-04-09 14:28:30 PDT; 1s ago
|
Main PID: 2436 (puppet)
|
CGroup: /system.slice/puppet.service
|
└─2436 /opt/puppetlabs/puppet/bin/ruby /opt/puppetlabs/puppet/bin/puppet agent --no-daemonize
|
|
service { 'puppet':
|
ensure => 'running',
|
enable => 'false',
|
}
|
|
[root@u8v9bdrz4y5vy3s ~]# systemctl stop puppet
|
[root@u8v9bdrz4y5vy3s ~]# systemctl status puppet
|
puppet.service - Puppet agent
|
Loaded: loaded (/usr/lib/systemd/system/puppet.service; disabled)
|
Active: inactive (dead)
|
[root@u8v9bdrz4y5vy3s ~]# puppet resource service puppet service { 'puppet': ensure => 'stopped', enable => 'false', }
|
h6. General Smoke testing
|
|
Looks good.
|
|
* Version
|
[root@b9jwu5zgzhdgs1d ~]# puppet --version 4.0.0
[root@b9jwu5zgzhdgs1d ~]# puppet apply -e "notify {'test':}
" Notice: Compiled catalog for b9jwu5zgzhdgs1d.delivery.puppetlabs.net in environment production in 0.31 seconds Notice: test Notice: /Stage[main]/Main/Notify[test]/message: defined 'message' as 'test' Notice: Applied catalog in 0.01 seconds
[root@b9jwu5zgzhdgs1d ~]# puppet master --verbose --no-daemonize Notice: Starting Puppet master version 4.0.0
|
* Write and run some manifests
|
|
Given the manifest:
|
node default { package { 'apache2': ensure => installed, }
file { '/tmp/test': ensure => file, mode => '0644', content => 'Hello, world!', }
notify { 'Notify!': }
}
[root@b9jwu5zgzhdgs1d ~]# puppet agent -t Info: Retrieving pluginfacts Info: Retrieving plugin Info: Caching catalog for b9jwu5zgzhdgs1d.delivery.puppetlabs.net Info: Applying configuration version '1428613077' Notice: /Stage[main]/Main/Node[default]/Package[httpd]/ensure: created Notice: /Stage[main]/Main/Node[default]/File[/tmp/test]/ensure: defined content as ' {md5}
6cd3556deb0da54bca060b4c39479839' Notice: Notify! Notice: /Stage[main]/Main/Node[default]/Notify[Notify!]/message: defined 'message' as 'Notify!' Notice: Applied catalog in 2.35 seconds
root@b9jwu5zgzhdgs1d:/etc/puppet# cat /tmp/test Hello, world!
|