Forge Home

puppet_device

Manage devices used by 'puppet device' on puppet agents.

23,047 downloads

5,735 latest version

5.0 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 2.5.0 (latest)
  • 2.4.7
  • 2.4.6
  • 2.4.5
  • 2.4.4
  • 2.4.3
  • 2.4.2
  • 2.4.1
  • 2.4.0
  • 2.3.7
  • 2.3.6
  • 2.3.5
  • 2.3.4
  • 2.3.3
  • 2.3.2
  • 2.3.0
  • 2.2.0 (deleted)
  • 2.1.2
  • 2.1.1
  • 2.1.0
  • 2.0.1
  • 2.0.0
  • 1.1.1
  • 1.1.0 (deleted)
  • 1.0.9 (deleted)
  • 1.0.8
  • 1.0.7
  • 1.0.6
  • 1.0.5
  • 1.0.4 (deleted)
  • 1.0.3 (deleted)
  • 1.0.2 (deleted)
  • 1.0.1 (deleted)
  • 1.0.0 (deleted)
released Oct 17th 2017
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

tkishel/puppet_device — version 2.0.1 Oct 17th 2017

puppet_device

Table of Contents

  1. Description
  2. Usage
  3. Parameters
  4. Orchestration
  5. Reference

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