On Monday, November 11, 2013 3:30:36 AM UTC-6, shazni nazeer wrote: > > Hi Rich, > > Thanks for the reply. May be I'm trying to do what puppet is not designed > for. I had the requirement of replacing a directory with another directory > and then run a script to test certain things with that directory content, > and once that completed I wanted the same directory to be replaced with a > completely different directory and run another script. The problem is how > do I replace the same directory twice at two different times? >
Puppet is not a script engine; it is a state management service. You describe a target machine state to Puppet, and Puppet puts the machine into that state. You cannot declare two different target states for the same physical resource because it does not make sense. The longstanding system design in fact enforces a stronger constraint that you cannot declare the same resource twice, even with the same properties. You cannot manage the same resource into two or more different states during the same Puppet run. You could conceivably perform multiple runs, perhaps selecting which test to perform via tags, but at that point you have to consider why you are using Puppet for the job instead of some other system for which it is a more natural fit. > That's why I told, this may not be achievable in puppet, because it's not > designed to perform these sort of works. > > Oh, it's achievable. At worst, you can write up a shell script that performs the whole job, including file manipulation, and have Puppet run it via an Exec resource. I think, however, that you might be looking for an automated testing framework as your top-level system. You could perhaps integrate Puppet into your system at a lower level, using it (say) on a per-test-case basis to set up your test fixtures. John -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/4aee8fee-b74f-449a-80ce-c7fd76fbbe9c%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.