Dry run in puppet is a powerful feature given by puppet. This basically is used to test your Puppet manifests on any of the environment without actually making any changes to the machine.
To dry-run Puppet, --noop flag needs to be used.
Puppet’s ‘noop’ (no-operation) mode shows you what would happen, but actually doesn’t do anything :)
This basically helps us for debugging stuff.
For instance:
[root@puppet manifests]# puppet apply site.pp --noop
notice: /Stage[main]/Sudo/File[/etc/sudoers]/content: current_value {md5}e81452ad78198a79772447b1f2b3b614, should be {md5}e2d690ebe349d93efa84146eb854c987 (noop)
notice: Class[Sudo]: Would have triggered 'refresh' from 1 events
notice: /Stage[main]/Ssh::Service/Service[sshd]/ensure: current_value stopped, should be running (noop)
notice: Class[Ssh::Service]: Would have triggered 'refresh' from 1 events
notice: Stage[main]: Would have triggered 'refresh' from 2 events
notice: Finished catalog run in 2.75 seconds
[root@puppet manifests]#
First noop =>
notice: /Stage[main]/Sudo/File[/etc/sudoers]/content: current_value
{md5}e81452ad78198a79772447b1f2b3b614, should be
{md5}e2d690ebe349d93efa84146eb854c987 (noop)
Above value states that there will be some modification to the sudoers file which will be made once puppet is executed.
Second noop =>
notice: /Stage[main]/Ssh::Service/Service[sshd]/ensure: current_value stopped, should be running (noop)
Second one is sshd daemon will be triggered when puppet will be executed.
I am okay with both the changes which are going to happen to the machine, so what I will do is remove the --noop flag and run puppet.
[root@puppet manifests]# puppet apply site.pp
notice: /Stage[main]/Sudo/File[/etc/sudoers]/content: content changed '{md5}e81452ad78198a79772447b1f2b3b614' to '{md5}e2d690ebe349d93efa84146eb854c987'
notice: /Stage[main]/Ssh::Service/Service[sshd]/ensure: ensure changed 'stopped' to 'running'
notice: Finished catalog run in 0.54 seconds
[root@puppet manifests]#
Comments
Post a Comment