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": ...

Get Mastering Puppet 5 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.