puppet_device
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
- , ,
This module has been deprecated by its author since Jun 1st 2018.
The author has suggested puppetlabs-device_manager as its replacement.
Tasks:
- puppet_device
Start using this module
Documentation
puppet_device
Table of Contents
Description
Devices require a (proxy) Puppet agent to request certificates, collect facts, retrieve and apply catalogs, and store reports. This module manages the configuration file used by the puppet device
command on Puppet agents; defines a structured fact that can be used to query PuppetDB to identify the Puppet agent proxying for a device; provides a puppet_device
task for direct orchestration of puppet device
runs on Puppet agents; and provides indirect orchestration of puppet device
runs on older Puppet agents that do not support tasks.
Usage
Install the puppet_device
module:
puppet module install tkishel-puppet_device
Declare individual puppet_device
resources in a manifest of a Puppet agent:
node 'agent.example.com' {
class {'f5': }
puppet_device {'bigip.example.com':
type => 'f5',
url => 'https://admin:fffff55555@10.0.0.245/',
}
}
Or, declare multiple puppet_device
resources in Hiera ...
---
puppet_device::devices:
bigip1.example.com:
type: 'f5'
url: 'https://admin:fffff55555@10.0.1.245/'
bigip2.example.com:
type: 'f5'
url: 'https://admin:fffff55555@10.0.2.245/'
... and declare the puppet_device::devices
class:
node 'agent.example.com' {
class {'f5': }
include puppet_device::devices
}
(Note that an f5 device is used as an example, but this module is not limited to F5 devices.)
Parameters
name
Data type: String
Specifies the certname
of the device.
This parameter is optional, and defaults to the title of the resource.
ensure
Data type: String
This parameter is optional, with valid options of 'present' (the default) and 'absent'.
Setting to 'absent' deletes the device from device.conf
and the puppet_devices
fact, and negates the effect of any other parameters.
type
Data type: String
Specifies the type of the device.
url
Data type: String
Specifies the URL used to configure the device.
debug
Data type: Boolean
This parameter is optional, with a default of false.
Specifies transport-level debug output for the device, and is limited to telnet and ssh transports.
autorun
Data type: Boolean
This parameter is optional, with a default of false.
Specifies whether to automatically run puppet device
during each puppet agent
run on the Puppet agent.
Setting autorun
to true will create an Exec resource for all devices on the Puppet agent. On versions of Puppet (Puppet 5.x.x or higher) that support puppet device --target
, setting autorun
to true will create an Exec resource for each device on the Puppet agent. Note that this will increase the execution time of a puppet agent
run by the execution time of each puppet device
run.
Orchestration
Puppet Task
On versions of Puppet Enterprise (2017.3.x or higher) that support tasks, this module provides a puppet_device
task which can be used by the puppet task
command to orchestrate a puppet device
run on a (proxy) Puppet agent.
To orchestrate a run of the puppet device
command, for all devices on a specified Puppet agent:
puppet task run puppet_device --nodes 'agent.example.com'
To orchestrate a run of the puppet device
command, for all devices on a Puppet agent identified by a PuppetDB query:
puppet task run puppet_device --query 'inventory { facts.puppet_devices."bigip.example.com" = true }'
To orchestrate a run of the puppet device --target
command, for a specific device on a Puppet agent identified by a PuppetDB query:
puppet task run puppet_device --query 'inventory { facts.puppet_devices."bigip.example.com" = true }' target=bigip.example.com
For help with the puppet_device
task, run the puppet task show puppet_device
command.
Puppet Job
On versions of Puppet Enterprise (2017.2.x or lower) that do not support tasks, this module provides an autorun
parameter which can be used by the puppet job
command to indirectly orchestrate a puppet device
run via a puppet agent
run on the (proxy) Puppet agent.
To orchestrate a run of the puppet device
command (for each device with autorun
set to true) on a specified Puppet agent:
puppet job run --nodes 'agent.example.com'
To orchestrate a run of the puppet device
command (for each device with autorun
set to true) on a Puppet agent identified by a PuppetDB query:
puppet job run --query 'inventory { facts.puppet_devices."bigip.example.com" = true }'
Reference
For more information, see:
https://docs.puppet.com/puppet/latest/man/device.html
https://docs.puppet.com/puppet/latest/config_file_device.html
https://puppet.com/docs/pe/latest/orchestrator/running_tasks.html
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
Release 2.0.1
- Fix anchor in README.
- Simplify run.
Summary
Minor changes.
Release 2.0.0
- Add support for tasks.
- Rename the run paramater to autorun.
- Change structured fact format from array to hash.
- Fully qualify the path to the test command.
- Normalize the waitforcert and user parameters of the puppet device command.
Summary
This release adds support for tasks, and uses Puppet Development Kit (PDK).
Release 1.1.1
Summary
Minor changes.
Changed
- Test version to choose between hiera_hash and lookup.
- Use show_diff=false in concat to not log changes to device.conf.
Release 1.1.0
Summary
Minor changes.
Changed
- Use hiera_hash to improve compatibility.
- Use iteration instead of create_resource to improve readability.
Release 1.0.9
Summary
This release allows users to declare devices as a hash of hashes in Hiera.
Features/Improvements
- Implement a CHANGELOG.
- Adds support for declaring devices in Hiera.
Dependencies
- puppetlabs/concat (>= 3.0.0 < 5.0.0)
- puppetlabs/stdlib (>= 4.10.0 < 5.0.0)