> I probably waste quite a bit of time each week restarting the puppet client, and logging systems, and tailing the messages file, to see if my puppet changes worked. Is there a better way? How do people normally do this?
I use monit to keep the puppet agent running in case it craps out, and puppet dashboard to keep an eye on all my nodes.
-bjc
1) Don't run puppet as a daemon, but run it out of cron every X mins.
2) Setup a cronjob that checks if puppet is running and restart it if not.
3) Setup a nagios job that checks to see if puppet is running
4) Presuming you are managing your puppet code in some sort of version
control system, you can "publish" the latest timestamp of your latest
commit, and also push that out via puppet, and setup a nagios check
that compares them and if they ever are behind by more than X mins you
can crit on it. You could take this a step further and have nagios
automatically restart puppet if they are behind, but if you think it
might be a syntax error, I would probably skip that. (As an aside you
should do syntax checking before committing. I added the commands to
do so below)
5) Foreman (or dashboard) can monitor puppet runs, and flag any broken runs.
Check syntax:
puppet --noop --parseonly memcached.pp
Check erb syntax:
erb -x -T '-' memcached-sessions.erb |ruby -c
We use a combination of 2,3,4 and 5.
Cheers,
Brian
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To post to this group, send email to puppet...@googlegroups.com.
> To unsubscribe from this group, send email to
> puppet-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.
>
----- Original Message -----
> Basically the ways I know of:
>
> 1) Don't run puppet as a daemon, but run it out of cron every X mins.
> 2) Setup a cronjob that checks if puppet is running and restart it if
> not.
> 3) Setup a nagios job that checks to see if puppet is running
> 4) Presuming you are managing your puppet code in some sort of
> version
> control system, you can "publish" the latest timestamp of your latest
> commit, and also push that out via puppet, and setup a nagios check
> that compares them and if they ever are behind by more than X mins
> you
> can crit on it. You could take this a step further and have nagios
> automatically restart puppet if they are behind, but if you think it
> might be a syntax error, I would probably skip that. (As an aside you
> should do syntax checking before committing. I added the commands to
> do so below)
> 5) Foreman (or dashboard) can monitor puppet runs, and flag any
> broken runs.
6) use the last run summary
# cat /var/lib/puppet/state/last_run_summary.yaml
---
time:
group: 0.000852
last_run: 1306343446
class: 0.002389
yumrepo: 0.037513
service: 2.300486
schedule: 0.002291
cron: 0.001797
config_retrieval: 18.9993901252747
total: 37.9802451252747
package: 0.371819
filebucket: 0.00032
file: 15.664177
exec: 0.593368
user: 0.005843
resources:
total: 384
events:
total: 0
changes:
Basically the ways I know of:
1) Don't run puppet as a daemon, but run it out of cron every X mins.
2) Setup a cronjob that checks if puppet is running and restart it if not.
3) Setup a nagios job that checks to see if puppet is running
4) Presuming you are managing your puppet code in some sort of version
control system, you can "publish" the latest timestamp of your latest
commit, and also push that out via puppet, and setup a nagios check
that compares them and if they ever are behind by more than X mins you
can crit on it. You could take this a step further and have nagios
automatically restart puppet if they are behind, but if you think it
might be a syntax error, I would probably skip that. (As an aside you
should do syntax checking before committing. I added the commands to
do so below)
5) Foreman (or dashboard) can monitor puppet runs, and flag any broken runs.
Check syntax:
puppet --noop --parseonly memcached.pp
Check erb syntax:
erb -x -T '-' memcached-sessions.erb |ruby -c
We use a combination of 2,3,4 and 5.
Mcollective with mc-puppet should work if you patch it to not daemonize (you'll need to adjust the timeouts as well, of course). Errors running will bubble up to the list of nodes that failed the run.
We log to a central syslog server, and send out a daily email of any
changes/failures.
>
> I use monit to keep the puppet agent running in case it
>craps out, and puppet dashboard to keep an eye on all my nodes.
We also use storedconfigs and can just query the compiled time to see if
any clients stopped reporting.
>
>-bjc
>
>--
>You received this message because you are subscribed to the
>Google Groups "Puppet Users" group.
>To post to this group, send email to puppet...@googlegroups.com.
>To unsubscribe from this group, send email to
>puppet-users...@googlegroups.com.
>For more options, visit this group at
>http://groups.google.com/group/puppet-users?hl=en.
>
>
This email communication and any files transmitted with it may contain confidential and or proprietary information and is provided for the use of the intended recipient only. Any review, retransmission or dissemination of this information by anyone other than the intended recipient is prohibited. If you receive this email in error, please contact the sender and delete this communication and any copies immediately. Thank you.
http://www.encana.com
Mcollective hides successes and only shows you failures, keeping the signal to noise ratio very high.If you run puppet without daemonizing, anything that causes the config to not be applied successfully is going to show up as an error.
What do you mean by "executed successfully"? Assuming I understand
your question correctly, if it is untested code, and it passes a
syntax checker, and doesn't generate errors, you pretty much need to
spot check at least one one system that the code in question does what
you intended. Many folks do this in a dev environment, before pushing
it to their puppetmaster. I don't really see a way around this that
wouldn't end up being a lot more work than it's worth.
Executed successfully =a) No syntax errorsb) No dependency errorsc) No other weird stuffJust because there are no dependency errors on one system, doesn't mean that there won't be dependency errors on another system. No two systems are ever identical, so spot checks won't cover all bases.We're a startup with limited resources, with the typical total lack of resources. We don't have the luxury of a dev environment. We have 4 data centres, different rules for each, and one is PCI compliant, which is akin to having a root canal done every time you touch it. Even if we did, that doesn't preclude making sure everything ran ok. It's still needed.Doug.
I have to concur with disconnect, now that we are using Foreman, many
of the things we setup in the past to catch these things are now
redundant. I don't know why you "don't like" Foreman, but I have to
say along with our initial decision to use puppet, and managing our
configs with version control, adopting Foreman stands up there as one
of our big infrastructure management wins. (And we aren't even
using Foreman's provisioning capabilities).
May I ask why you don't like Foreman? (We were for a long time
hesitant to use Foreman, as it wasn't an "official" project, but we
had reached a point where we needed a new ENC, and a technical
evaluation of both Foreman and Dashboard lead us to the realization
that functionality-wise it was a lot closer to what we needed. (And I
suspect your needs may be similar to ours.)
Cheers,
Brian
Douglas,
I have to concur with disconnect, now that we are using Foreman, many
of the things we setup in the past to catch these things are now
redundant. I don't know why you "don't like" Foreman, but I have to
say along with our initial decision to use puppet, and managing our
configs with version control, adopting Foreman stands up there as one
of our big infrastructure management wins. (And we aren't even
using Foreman's provisioning capabilities).
May I ask why you don't like Foreman? (We were for a long time
hesitant to use Foreman, as it wasn't an "official" project, but we
had reached a point where we needed a new ENC, and a technical
evaluation of both Foreman and Dashboard lead us to the realization
that functionality-wise it was a lot closer to what we needed. (And I
suspect your needs may be similar to ours.)
Maybe if you edit /foreman-location/config/settings.yaml and
uncomment :modulepath and set it to your modulepath and then restart
the webserver? This is just an educated guess as I use a standard
location, but that seems like a good start. Otherwise, if you have
more questions about foreman you can check http://groups.google.com/group/foreman-users