Manifest correctly applied but error returned
Closed this issue · 2 comments
Hey there,
I've just started to dig Puppet and EOS and I've encountered some issues during the journey.
I'm using Puppet 4.3.2 on both Server (an Ubuntu 14.04 VM) and Agent (vEOS).
I've created the ~/environments/production/manifests/
directory and put here this site.pp
manifest:
node 'test.test.com' {
eos_vlan { "20":
vlan_name => "Testing",
ensure => present,
}
}
Then, I started the server with puppet master --no-daemonize --verbose
and the agent puppet agent -t
, obtaining this:
test#puppet agent -t
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Caching catalog for test.test.com
Info: Applying configuration version '1456663047'
Notice: /Stage[main]/Main/Node[test.test.com]/Eos_vlan[20]/ensure: created
Notice: Applied catalog in 0.95 seconds
'sudo /opt/puppetlabs/bin/puppet agent -t' returned error code:2
Here, the manifest is correctly applied and the VLAN is configured, but I also receive that error.
test#sh vlan 20
VLAN Name Status Ports
----- -------------------------------- --------- -------------------------------
20 Testing active
Why is this?
Everything is working properly. Puppet has a series of unfortunately named items and this is one of them. 2 is not an "error" code but an "exit" code. An exit code of 2 means that changes were successfully applied. See --detailed-exitcodes in https://docs.puppetlabs.com/puppet/latest/reference/man/agent.html#OPTIONS for more information.
If you were to re-run the agent, you should receive an exit code of 0 indicating that the node is in compliance and no changes were necessary.
-Jere
Oh thanks Jere for the explanation, my bad! :)
Gabriele