dc12078@gmail.com
2014-Feb-04 23:11 UTC
[Puppet Users] Please help with control/ordering issue
Hi, im trying to work some logic into a puppet class and I'm not sure the best way to do it. For this application, I have an installation phase, a setup phase, and then a maintenance phase. My current method of maintaining this is to call the relevant subclass using "include". I then have to go comment out two of the 3 includes depending on which phase i'm on. This of course means that I have to shut off puppet on all the nodes im not directly working on. I would like to use the following logic in my class to control this. Could somebody help me with the proper syntax to get this working? class myapp { Class['myapp::phase1'] only if [ ! -e /path/to/puppet.phase ] # myapp::phase1 will echo 'phase2' into /path/to/puppet.phase once all requirements are met Class['myapp::phase2'] only if [ $(cat /path/to/puppet.phase) == 'phase2' ] # myapp::phase2 will echo 'phase3' into /path/to/puppet.phase once all requirements are met Class['myapp::phase3'] only if [ $(cat /path/to/puppet.phase) == 'phase3' ] } -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/2c4124a2-dfd1-4006-b5c0-b66e026dfe5e%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.