Noop some classes/ressources

18 views
Skip to first unread message

Poil

unread,
Dec 10, 2013, 1:56:55 PM12/10/13
to puppet...@googlegroups.com
Hi,

I would like to set to noop some classes (not all) for some server
groups. (For example, we can have 2 types of modules, IT and Middleware,
IT must be in no-noop and Middleware must be in noop)

Today my idea is to have a parameters (via ENC or hiera,
!noop_state=true/false) and add a noop=$noop_state on all ressources of
theses classes.

Is there a better way to do this ? Any comment ?

I use puppet 3.2.*

Best regards,

William Leese

unread,
Dec 13, 2013, 2:38:53 AM12/13/13
to puppet...@googlegroups.com
I would like to set to noop some classes (not all) for some server
groups. (For example, we can have 2 types of modules, IT and Middleware,
IT must be in no-noop and Middleware must be in noop)

So you would like to sometimes apply a nodes assigned classes and sometimes not? That sounds like a strange usecase. If it's just a case of 'sometimes' as in some actually puppetruns, you could use something like cronjobbed 'puppet agent --test --tags=<all,the,classes,I,do,want,to,apply>'.

If on the other hand your puppet environment is set up to apply classes to nodes that shouldn't be applied, you would be advised to look into how to only assign the necessary classes to the server group requiring them, rather than creating a parameter to every class to turn them on and off at will. Things like a custom fact that parses IP's or hostnames, returns a <server group> string and then using that as part of hiera.yaml and doing your classes assignment might be an idea.
Reply all
Reply to author
Forward
0 new messages