Cathal O Mul writes:
 > I have a file call pr.sh it is a scrip I would like puppet to run it
 > how would I go about doing this

This is what Puppet "exec" resources are for, although one should use
those sparingly and only if what you want to accomplish can't be done
using some other resource type.  In particular unless you specify the
"exec" carefully, Puppet may run the exec multiple times, even within
the same Puppet agent invocation, so the script should be written to
handle that case cleanly.

So you would start with something like:

exec { "/path/to/pr.sh":
}

And then add one or more attributes to ensure the script is run only
when the necessary conditions apply.  These might include:

        refreshonly => true,

        # run the exec when the specified file resource is updated
        subscribe => File["/some/input/file"],
        # alternatively the file resource can have
        # notify => Exec["/path/to/pr.sh"],

        # run another command and do this exec only if it exits successfully
        onlyif => "..."

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/21474.33509.1048.226555%40shell.uoregon.edu.
For more options, visit https://groups.google.com/d/optout.

Reply via email to