Ask Your Question
0

Is there a way to have the Puppet Agent enforce one class while the rest run in NOOP mode?

asked 2018-01-30 08:10:48 -0600

JGIorio gravatar image

I have a puppet_agent module which sets up whether the agent runs in NOOP mode and set an interval. Well because it sets NOOP mode no changes ever occur to the puppet.conf when I change the value of runinterval.

Is there a way to enforce the puppet-agent module but leave the rest of the modules to run in NOOP mode?

Something about nonoop is what I think

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2018-04-10 05:19:17 -0600

I wrote a blog post about this and noop related matters, find it here: https://www.example42.com/2017/12/27/noop-no-noop-and-the-path-to-safe-puppet-deployments/

Short answer; in the classes where you want to force no-noop add something like:

noop(false)

And possibly do this conditionally based on a class parameter. You need to have trlinkin-noop module.

edit flag offensive delete link more

Comments

This is the correct answer.

ffalor gravatar imageffalor ( 2018-04-10 08:14:48 -0600 )edit
1

answered 2018-01-30 13:19:16 -0600

greynolds gravatar image

You may want to create a custom fact, then add script to the exec file to be invoked. Meaning as an example:

if &operatingsystem == /[(RHEL)]/: file => /root/myscript.sh, ensure => present,

  exec  => 'run_this_class":
  cmd => '/bin /root/myscript.sh,
  path => '/bin:/sbin:/usr/local/bin:/usr/local/sbin

You could place this in any class you have written.

   myscript.sh
  puppet apply  'name of class'
  puppet agent -t --noop

or add

joshs/agent_noop

to your classification and pin the nodes.

What I am not clear about? If you want the default puppet run to exec on a single node and noop everyone in a particular class? Maybe a little more insight before I get to deep into the weeds will help.

edit flag offensive delete link more

Comments

It sounds like he wants a set of modules to run in no-op mode, but he wants a module to run in regular mode to manage puppet... the only thing I can think of in that case (other than globally setting some kind of no-op param for a subset of 'roles' for other modules would be two different runs with

DarylW gravatar imageDarylW ( 2018-01-31 08:22:23 -0600 )edit

.. two different environments or calls, and have puppet running not as a daemon, but as two separate sets of 'puppet apply' calls in a cron, or one as apply in a cron and the other as a deamon. ... I'm assuming he wants some kind of 'audit' visibility, but to not 'break' the system and manage puppet

DarylW gravatar imageDarylW ( 2018-01-31 08:23:44 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2018-01-30 08:10:48 -0600

Seen: 56 times

Last updated: Apr 10