diff --git a/README.md b/README.md index c1ec0b8..f8952cc 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,13 @@ bolt task run taskplan \ ### Plan-specific tailored taskplan task -To create a plan-specific tailored taskplan task, use something like the following: +The task `taskplan` is generic, and can run any plan, but because it permits the user to pass arbitrary command line flags to Bolt, it is effectively a privileged task. + +As an alternative to permitting users to run the generic privileged task, a plan-specific tailored task, built on taskplan, can be created. + +To create a tailored plan-specific taskplan, use the following pattern. + +tailored.json file: ```json { @@ -40,6 +46,8 @@ To create a plan-specific tailored taskplan task, use something like the followi } ``` +tailored.rb file: + ```ruby #!/opt/puppetlabs/puppet/bin/ruby require 'json' diff --git a/plans/test.pp b/plans/test.pp index d2d2ccc..69084ed 100644 --- a/plans/test.pp +++ b/plans/test.pp @@ -2,6 +2,6 @@ String $message, ) { - notice("Ran taskplan::test! Message: ${message}") + return("Ran taskplan::test! Message: ${message}") } diff --git a/tasks/init.json b/tasks/init.json index 2644f19..b8ba32d 100644 --- a/tasks/init.json +++ b/tasks/init.json @@ -1,17 +1,18 @@ { - "description": "Run a Puppet task plan with Bolt", + "description": "A task to run a Puppet plan with Bolt", "parameters": { "plan": { "type": "String[1]", - "description": "The task plan to run" + "description": "The plan to run" }, "params": { "type": "Hash", - "description": "Parameters to give to the task plan" + "description": "Parameters to give to the plan" }, "arguments": { "type": "Hash", - "description": "Hash of Bolt arguments to pass, e.g.: {modulepath=>/expl/path, ssl-verify=>false}" + "description": "Hash of Bolt arguments to pass, e.g.: {modulepath=>/expl/path, ssl-verify=>false}", + "default": { } }, "debug": { "type": "Optional[Boolean]",