task.json

This JSON parameter file is an optional component for tasks and allows the passing of parameters as environment variables to our scripts. We can use this file to also limit user input as well, leaving a small number of options available for our users if necessary. In the following example, our script will accept a log and store the parameter. The log parameter will only allow three choices, which determine where to find the log file the user is searching for. The store parameter will be off by default, but will allow us to aggregate logs for the plan we'll build in the next section:

#logs/tasks/puppetserver.json
{
"puppet_task_version": 1,
"supports_noop": false,
"description": "Retrieve a log file from the puppetserver",
"parameters": {
"log": {
"description": "The Puppetserver log you want to read",
"type": "Enum[console,puppetdb,puppetserver]"
},
"store": {
"description": "Store logfile in /tmp/puppetlog.log",
"type": "Optional[Boolean]"
}
}
}
The parameters use the same data types as Puppet. You can use any data type available to Puppet as a data type for Puppet tasks.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.17.184.90