bolt_pe
Version information
This version is compatible with:
- Puppet Enterprise 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x, 2019.8.x
- Puppet >= 6.21.0 < 8.0.0
- , , , , , , ,
Tasks:
- get_targets_from_node_groups
- terrafom_apply
- terrafom_destroy
- terrafom_initialize
- terrafom_output
Plans:
- get_node_groups
- terraform_apply
- terraform_destroy
Start using this module
Add this module to your Puppetfile:
mod 'betadots-bolt_pe', '1.0.1'
Learn more about managing modules with a PuppetfileDocumentation
bolt_pe
This modules delivers extensions to be used with Puppet Enterprise.
Table of Contents
- Description
- Setup - The basics of getting started with bolt_pe
- Usage - Configuration options and additional functionality
Description
Tasks and Plans
Terraform
On Puppet Enterprise the terraform tasks and plans are not available. These are only available within Bolt Open Source.
This module delivers the terraform tasks and plans and places them under a new namespace: bolt_pe
Get Targets from Node Groups
On Puppet Enterprise on can group servers into node groups. This module provides a task which will read an exusting node group and return the nodes from the provided node group.
Usage is straight forward like an other Puppet Task:
plan foo (
Enum['All Nodes', 'Production Environment'] $node_group,
String $puppet_server,
) {
$targets = run_task('bolt_pe::get_targets_from_node_groups', $puppet_server, 'node_group' => $node_group)
$targets.each |$target| {
# ...
}
}
Setup
Setup Requirements
This module needs the puppetlabs-ruby_task_helper module.
Beginning with bolt_pe
Bolt_pe has no Puppet classes. It only consists of tasks, plans and functions.
Usage
Add this module and the ruby_task_helper module to your Puppet Enterprise Server. This can be achieved by adding the modules to your control-repo Puppetfile.
Afterwards you should see the tasks in Puppet Enterprise console.
Reference
Table of Contents
Classes
bolt_pe
: Class: bolt_pe
Tasks
get_targets_from_node_groups
: This task reads node groups from PE console and returns an array of nodes being part of the node groupterrafom_apply
: Apply an HCL manifestterrafom_destroy
: Destroy resources managed with Terraformterrafom_initialize
: Initialize a Terraform project directoryterrafom_output
: JSON representation of Terraform outputsterrafom_resolve_reference
: Generate targets from Terraform Statefile
Plans
bolt_pe::get_node_groups
: get all node groups and print to stdoutbolt_pe::terraform_apply
bolt_pe::terraform_destroy
Classes
bolt_pe
Class: bolt_pe
Tasks
get_targets_from_node_groups
This task reads node groups from PE console and returns an array of nodes being part of the node group
Supports noop? false
Parameters
node_group
Data type: String
Name of the node group
terrafom_apply
Apply an HCL manifest
Supports noop? false
Parameters
dir
Data type: Optional[String[1]]
Path to Terraform project directory. Path is relative to CWD, unless an absolute path is specified.
state
Data type: Optional[String[1]]
Path to read and save state. Defaults to "terraform.tfstate". Path is relative to "dir"
target
Data type: Optional[Variant[String[1], Array[String[1]]]]
Resource to target. Operation will be limited to this resource and its dependencies. Accepts a single resource string or an array of resources
var
Data type: Optional[Hash]
Set Terraform variables, expects a hash with key value pairs representing variables and values.
var_file
Data type: Optional[Variant[String[1], Array[String[1]]]]
Set variables in the Terraform configuration from a file. Path is relative to "dir". Accepts a single var-file path or an array of paths
state_out
Data type: Optional[String[1]]
Path to write state to that is different than "state". This can be used to preserve the old state.
terrafom_destroy
Destroy resources managed with Terraform
Supports noop? false
Parameters
dir
Data type: Optional[String[1]]
Path to Terraform project directory. Path is relative to CWD, unless an absolute path is specified.
state
Data type: Optional[String[1]]
Path to read and save state. Defaults to "terraform.tfstate", Path is relative to "dir"
target
Data type: Optional[Variant[String[1], Array[String[1]]]]
Resource to target. Operation will be limited to this resource and its dependencies. Accepts a single resource string or an array of resources
var
Data type: Optional[Hash]
Set Terraform variables, expects a hash with key value pairs representing variables and values.
var_file
Data type: Optional[Variant[String[1], Array[String[1]]]]
Set variables in the Terraform configuration from a file. Path is relative to "dir". Accepts a single var-file path or an array of paths
state_out
Data type: Optional[String[1]]
Path to write state to that is different than "state". This can be used to preserve the old state.
terrafom_initialize
Initialize a Terraform project directory
Supports noop? false
Parameters
dir
Data type: Optional[String[1]]
Path to Terraform project directory. Path is relative to CWD, unless an absolute path is specified.
terrafom_output
JSON representation of Terraform outputs
Supports noop? false
Parameters
dir
Data type: Optional[String[1]]
Path to Terraform project directory. Path is relative to CWD, unless an absolute path is specified.
state
Data type: Optional[String[1]]
Path to read and save state. Defaults to "terraform.tfstate", Path is relative to "dir"
terrafom_resolve_reference
Generate targets from Terraform Statefile
Supports noop? false
Parameters
dir
Data type: String[1]
resource_type
Data type: String[1]
state
Data type: Optional[String[1]]
backend
Data type: Optional[String[1]]
target_mapping
Data type: Hash
Plans
bolt_pe::get_node_groups
get all node groups and print to stdout
Parameters
The following parameters are available in the bolt_pe::get_node_groups
plan:
node_group
Data type: Enum['All Nodes', 'Production Environment']
puppet_server
Data type: String
bolt_pe::terraform_apply
The bolt_pe::terraform_apply class.
Parameters
The following parameters are available in the bolt_pe::terraform_apply
plan:
dir
Data type: Optional[String[1]]
Default value: undef
state
Data type: Optional[String[1]]
Default value: undef
state_out
Data type: Optional[String[1]]
Default value: undef
target
Data type: Optional[Variant[String[1], Array[String[1]]]]
Default value: undef
var
Data type: Optional[Hash]
Default value: undef
var_file
Data type: Optional[Variant[String[1], Array[String[1]]]]
Default value: undef
return_output
Data type: Optional[Boolean]
Default value: false
terraform_host
Data type: TargetSpec
bolt_pe::terraform_destroy
The bolt_pe::terraform_destroy class.
Parameters
The following parameters are available in the bolt_pe::terraform_destroy
plan:
dir
Data type: Optional[String[1]]
Default value: undef
state
Data type: Optional[String[1]]
Default value: undef
state_out
Data type: Optional[String[1]]
Default value: undef
target
Data type: Optional[Variant[String[1], Array[String[1]]]]
Default value: undef
var
Data type: Optional[Hash]
Default value: undef
var_file
Data type: Optional[Variant[String[1], Array[String[1]]]]
Default value: undef
terraform_host
Data type: TargetSpec
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.
Dependencies
- puppetlabs/ruby_task_helper (<= 0.6.0 < 1.0.0)