community.general.puppet – Runs puppet

Note

This plugin is part of the community.general collection (version 2.5.1).

To install it use: ansible-galaxy collection install community.general.

To use it in a playbook, specify: community.general.puppet.

Synopsis

  • Runs puppet agent or apply in a reliable manner.

Requirements

The below requirements are needed on the host that executes this module.

  • puppet

Parameters

Parameter Choices/Defaults Comments
certname
string
The name to use when handling certificates.
debug
boolean
    Choices:
  • no ←
  • yes
Enable full debugging.
environment
string
Puppet environment to be used.
execute
string
Execute a specific piece of Puppet code.
It has no effect with a puppetmaster.
facter_basename
string
Default:
"ansible"
Basename of the facter output file.
facts
dictionary
A dict of values to pass in as persistent external facter facts.
logdest
string
    Choices:
  • all
  • stdout ←
  • syslog
Where the puppet logs should go, if puppet apply is being used.
all will go to both stdout and syslog.
manifest
string
Path to the manifest file to run puppet apply on.
modulepath
string
Path to an alternate location for puppet modules.
noop
boolean
    Choices:
  • no
  • yes
Override puppet.conf noop mode.
When yes, run Puppet agent with --noop switch set.
When no, run Puppet agent with --no-noop switch set.
When unset (default), use default or puppet.conf value if defined.
puppetmaster
string
The hostname of the puppetmaster to contact.
summarize
boolean
    Choices:
  • no ←
  • yes
Whether to print a transaction summary.
tags
list / elements=string
A list of puppet tags to be used.
timeout
string
Default:
"30m"
How long to wait for puppet to finish.
use_srv_records
boolean
    Choices:
  • no
  • yes
Toggles use_srv_records flag
verbose
boolean
    Choices:
  • no ←
  • yes
Print extra information.

Examples

- name: Run puppet agent and fail if anything goes wrong
  community.general.puppet:

- name: Run puppet and timeout in 5 minutes
  community.general.puppet:
    timeout: 5m

- name: Run puppet using a different environment
  community.general.puppet:
    environment: testing

- name: Run puppet using a specific certname
  community.general.puppet:
    certname: agent01.example.com

- name: Run puppet using a specific piece of Puppet code. Has no effect with a puppetmaster
  community.general.puppet:
    execute: include ::mymodule

- name: Run puppet using a specific tags
  community.general.puppet:
    tags:
    - update
    - nginx

- name: Run puppet agent in noop mode
  community.general.puppet:
    noop: yes

- name: Run a manifest with debug, log to both syslog and stdout, specify module path
  community.general.puppet:
    modulepath: /etc/puppet/modules:/opt/stack/puppet-modules:/usr/share/openstack-puppet/modules
    logdest: all
    manifest: /var/lib/example/puppet_step_config.pp

Authors

  • Monty Taylor (@emonty)