How to discover that the puppet is complete

I need a way to detect that the puppet has finished the initial run (successfully), so I can wait before starting other actions when deploying the machines to AWS EC2 and / or OpenStack. How can I check this?

Some ideas popping up so far:

  • You have a puppet touch on the file after it is completed (successfully), I can just see this file
  • The puppet has a fact, when it is finished (successfully), I can check the facts through mcollective. (I’m not sure that recording to a puppet db from a puppet race is even possible).
+6
source share
2 answers
/var/lib/puppet/state/puppetdlock /var/lib/puppet/state/state.yaml /var/lib/puppet/state/last_run_summary.yaml 

These are the files you want to check.

The lock file is set if puppetd is currently running. State and last_run_summary can be used to see if past runs were successful or not.

See also this server question:

https://serverfault.com/questions/463231/check-if-puppet-agent-is-up-to-date

+5
source

I tried it on CentOS 6.4

If you run the Server / Client mode, check if the file exists:

/var/lib/puppet/state/agent_catalog_run.lock

If you run it offline, I don’t find that there is a lock file. You might need to parse the log file for this element, "Completed directory is executed in xxx seconds"

+1
source

Source: https://habr.com/ru/post/957210/


All Articles