puppet task run command options

The following are common options you can use with the task action. For a complete list of global options run puppet task --help.

Option Value Description
--noop Flag, default false Run a task to simulate changes without actually enforcing the changes.
--params String Specify a JSON object that includes the parameters, or specify the path to a JSON file containing the parameters, prefaced with @, for example, @/path/to/file.json. Do not use this flag if specifying parameter-value pairs inline; see more information below.
--environment, -e Environment name Use tasks installed in the specified environment.
--description Flag, defaults to empty Provide a description for the job, to be shown on the job list and job details pages, and returned with the puppet job show command.

You can pass parameters into the task one of two ways:

  • Inline, using the <PARAMETER>=<VALUE> syntax:

    puppet task run <TASK NAME> <PARAMETER>=<VALUE> <PARAMETER>=<VALUE> --nodes <LIST OF NODES>
    puppet task run my_task action=status service=my_service timeout=8 --nodes host1,host2,host3

  • With the --params option, as a JSON object or reference to a JSON file:

    puppet task run <TASK NAME> --params '<JSON OBJECT>' --nodes <LIST OF NODES>
    puppet task run my_task --params '{ "action":"status", "service":"my_service", "timeout":8 }' --nodes host1,host2,host3
    puppet task run my_task --params @/path/to/file.json  --nodes host1,host2,host3

You can't combine these two ways of passing in parameters; choose either inline or --params. If you use the inline way, parameter types other than string, integer, double, and Boolean will be interpreted as strings. Use the --params method if you want them read as their original type.