Version information
This version is compatible with:
- Puppet Enterprise 2018.1.x, 2017.3.x, 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
- Puppet >= 4.7.0 < 6.0.0
- , , , , , , ,
Tasks:
- taskplan
Plans:
- test
Start using this module
Add this module to your Puppetfile:
mod 'reidmv-taskplan', '0.2.3'
Learn more about managing modules with a PuppetfileDocumentation
taskplan
Description
This module provides a task for running Puppet task plans by invoking Bolt on the target system.
This can be useful because it provides a shim into invoking task plans programatically via an API, since tasks can be invoked via an API. Therefore, if we have a task that can invoke a plan, we have a means of invoking a plan via the Puppet orchestrator API.
Example Usage
bolt task run taskplan \
--modulepath /example/modules \
--nodes local://localhost \
--params '{"plan":"taskplan::test","params":{"message":"Hello"},"arguments":{"modulepath":"/example/modules"}}'
Plan-specific tailored taskplan task
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:
{
"description": "Sample plan-specific tailored taskplan task",
"parameters": {
"my_plans_parameter": {
"type": "String",
"description": "The first parameter from the plan"
},
"my_plans_other_parameter": {
"type": "Integer",
"description": "Another parameter from the plan"
}
},
"input_method": "stdin",
"files": [
"taskplan/tasks/init.rb"
]
}
tailored.rb file:
#!/opt/puppetlabs/puppet/bin/ruby
require 'json'
$params = {
'params' => JSON.parse(STDIN.read),
'plan' => 'example::myplan',
}
taskplanrb = File.join($params['params']['_installdir'], 'taskplan', 'tasks', 'init.rb')
load(taskplanrb)
What are tasks?
Modules can contain tasks that take action outside of a desired state managed by Puppet. It’s perfect for troubleshooting or deploying one-off changes, distributing scripts to run across your infrastructure, or automating changes that need to happen in a particular order as part of an application deployment.
Tasks in this module release
What are plans?
Modules can contain plans that take action outside of a desired state managed by Puppet. It’s perfect for troubleshooting or deploying one-off changes, distributing scripts to run across your infrastructure, or automating changes that need to happen in a particular order as part of an application deployment.
Changelog
All notable changes to this project will be documented in this file.
Release 0.2.0
Features
Modifications to support tailored tasks that form custom task interfaces to specific plans.
Release 0.1.2
Bugfixes
Fix an issue where invoking Bolt can fail when taskplan is run via the Orchestrator due to HOME not being set.
Release 0.1.1
Bugfixes
Allow the taskplan task to locate the bolt executable in normal locations, even if those locations are not in the PATH.
Release 0.1.0
Features
Bugfixes
Known Issues