Puppet : Install2025/10/15 |
|
Install and setup the Configuration management tool [Puppet]. It's necessary to setup DNS or hosts settings to resolve names or IP address and also NTP settings first. |
|
| [1] | Configure Puppet on Server Host. |
|
root@dlp:~#
apt -y install puppetserver
root@dlp:~#
vi /etc/puppet/puppet.conf # add to last line
dns_alt_names = dlp.srv.world,dlp
# any [environment] name you like
environment = production
[main]
certname = dlp.srv.world
server = dlp.srv.world
systemctl restart puppetserver |
| [2] | Configure Puppet on Client Host. |
|
root@node01:~#
apt -y install puppet-agent
root@node01:~#
vi /etc/puppet/puppet.conf # add to last line
[main]
certname = node01.srv.world
server = dlp.srv.world
[agent]
server = dlp.srv.world
ca_server = dlp.srv.world
# interval for applying catalogs on server
# if set [0], always applied
# default is 30 minutes if the value is not set
runinterval = 30m
systemctl restart puppet |
| [3] | Enable certificate from Puppet Client on Puppet Server. |
|
root@dlp:~# puppetserver ca list --all
Requested Certificates:
node01.srv.world (SHA256) C2:AE:D4:3D:27:82:8F:E5:72:77:2B:71:A6:92:E3:61:61:DA:5C:0B:6F:F1:CF:CF:81:CB:0B:51:44:D9:15:1B
Signed Certificates:
dlp.srv.world (SHA256) 07:69:8B:7F:79:06:D4:44:83:FE:71:AD:59:28:AA:9C:60:A4:4E:9D:2C:DE:D6:18:C2:7D:B4:E6:D8:00:0D:63 alt names: ["DNS:dlp.srv.world", "DNS:dlp", "DNS:dlp.srv.world"] authorization extensions: [pp_cli_auth: true]
# sign root@dlp:~# puppetserver ca sign --certname node01.srv.world Successfully signed certificate request for node01.srv.world |
| [4] | Verify Puppet Server and Client work normally to create a test manifest. Puppet clients apply manifests on Puppet server for every 30 minutes by default, so wait for a moment to make sure the setting or if you'd like to make sure at once, reload Puppet Client daemon. |
|
# create a directory for putting manifests # for the name [production], specify the name set for [environment = ***] parameter in [puppet.conf] root@dlp:~# mkdir -p /etc/puppet/code/environments/production/manifests
root@dlp:~#
vi /etc/puppet/code/environments/production/manifests/site.pp # for example, create a [testgroup]
group { 'testgroup':
ensure => present,
gid => 2000,
}
# on Client host, reload puppet if you like to verify settings immediately root@node01:~# systemctl reload puppet
grep testgroup /etc/group testgroup:x:2000: |
| [5] | If you like to apply manifest manually on localhost, run like follows. |
|
root@dlp:~# puppet apply /etc/puppet/code/environments/production/manifests/site.pp Notice: Compiled catalog for dlp.srv.world in environment production in 0.01 seconds Notice: /Stage[main]/Main/Group[testgroup]/ensure: created Notice: Applied catalog in 0.03 seconds root@dlp:~# grep testgroup /etc/group testgroup:x:2000: |
| Sponsored Link |
|
|