Ticket ID #188 ‐ Sub‐Ticket: Applying a module to the node - GriffinKat/group-a GitHub Wiki

Applying the module to a node

In the management server go to

cd /etc/puppetlabs/code/environments/production/manifests/

image Then access the site.pp file by typing

sudo nano site.pp

In the 'DB' section of this file add the line 'include sudo'

image

When trying to apply the module to a node with this command

sudo puppet agent --server=mgmt-a.foo.org.nz --no-daemonize --verbose --onetime - don't run this

I encountered an error

image

I thought this indicated that there was an error with the mgmt certificates

sudo puppetserver ca list

image

To fix this I needed to regenerate the certificates on the mgmt server

To do this I ran the commands

puppetserver ca clean --certname mgmt-a
puppet ssl clean
puppet resource service puppetserver ensure=stopped
puppetserver ca generate --certname mgmt-a --ca-client
puppet resource service puppetserver ensure=running

Then ran the command

sudo puppet agent --server=mgmt-a.foo.org.nz --no-daemonize --verbose --onetime - don't run this

Which didn't work because the command is incorrect and should be

sudo puppet agent --server=mgmt-a --no-daemonize --verbose --onetime

Add 'include sudo' to the remaining nodes in the site.pp file

sudo nano site.pp to access the file

image

Then run

sudo puppet agent --server=mgmt-a --no-daemonize --verbose --onetime

To apply the configuration, the result should be

image