puppet needs to stop a service, do something, then start the service
I need to write puppet code that will stop a service, make a change to a file then start the service. I can not change the file wile it is running. That is why I need to stop the service first. I had this test code:
Code:
service { cupsd : ensure => stopped } -> file { "/home/testing": ensure => true } -> service { cupsd : ensure => running } Code:
Could not retrieve catalog from remote server: Error 400 on SERVER: Duplicate declaration: Service[cupsd] is already declared in file /etc/puppet/modules/test/manifests/init.pp at line 2; cannot redeclare on node Any help would be great. Thanks |
Puppet defines a state of a system, not how it is done, so if you need to run a series of operations, you'd write a script to do it, and deploy that via puppet with an exec http://docs.puppetlabs.com/reference...type.html#exec
You can't declare it twice as there is no order to the definitions, they aren't executed in order at all, so having two entries is just a direct contradiction of the other. |
All times are GMT -5. The time now is 05:06 PM. |