Puppet : Install
rev 2026/07/10
|
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] | If UFW is enabled on Puppet server, allow service port. |
|
root@dlp:~# ufw allow puppet Rule added Rule added (v6) |
| [3] | 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 |
| [4] | Enable certificate from Puppet Client on Puppet Server. |
|
root@dlp:~# puppetserver ca list --all
Requested Certificates:
node01.srv.world (SHA256) 76:76:4D:63:99:31:8D:BC:B6:FF:CD:A2:6A:98:A0:74:A9:7A:D6:87:02:40:6D:D9:D3:BF:9C:F7:84:2A:87:D5
Signed Certificates:
dlp.srv.world (SHA256) 2F:0B:51:3D:AC:4B:CB:D1:05:A5:D9:22:AA:07:1C:78:BB:3B:6A:B7:66:D5:20:83:10:DF:D3:62:4B:4A:99:FA 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 the following certificate requests: node01.srv.world |
| [5] | 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: |
| [6] | 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: |
