community.general.puppet (8.5.0) — module

Runs puppet

Authors: Monty Taylor (@emonty)

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

Runs C(puppet) agent or apply in a reliable manner.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Run puppet agent and fail if anything goes wrong
  community.general.puppet:
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Run puppet and timeout in 5 minutes
  community.general.puppet:
    timeout: 5m
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Run puppet using a different environment
  community.general.puppet:
    environment: testing
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Run puppet using a specific certname
  community.general.puppet:
    certname: agent01.example.com
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Run puppet using a specific piece of Puppet code. Has no effect with a puppetmaster
  community.general.puppet:
    execute: include ::mymodule
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Run puppet using a specific tags
  community.general.puppet:
    tags:
    - update
    - nginx
    skip_tags:
    - service
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Run puppet agent in noop mode
  community.general.puppet:
    noop: true
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Run a manifest with debug, log to both syslog and console, 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

Inputs

    
noop:
    description:
    - Override puppet.conf noop mode.
    - When V(true), run Puppet agent with C(--noop) switch set.
    - When V(false), run Puppet agent with C(--no-noop) switch set.
    - When unset (default), use default or puppet.conf value if defined.
    type: bool

tags:
    description:
    - A list of puppet tags to be used.
    elements: str
    type: list

debug:
    default: false
    description:
    - Enable full debugging.
    type: bool

facts:
    description:
    - A dict of values to pass in as persistent external facter facts.
    type: dict

confdir:
    description:
    - Path to the directory containing the puppet.conf file.
    type: str
    version_added: 5.1.0
    version_added_collection: community.general

execute:
    description:
    - Execute a specific piece of Puppet code.
    - It has no effect with a puppetmaster.
    type: str

logdest:
    choices:
    - all
    - stdout
    - syslog
    default: stdout
    description:
    - Where the puppet logs should go, if puppet apply is being used.
    - V(all) will go to both C(console) and C(syslog).
    - V(stdout) will be deprecated and replaced by C(console).
    type: str

timeout:
    default: 30m
    description:
    - How long to wait for C(puppet) to finish.
    type: str

verbose:
    default: false
    description:
    - Print extra information.
    type: bool

certname:
    description:
    - The name to use when handling certificates.
    type: str

manifest:
    description:
    - Path to the manifest file to run puppet apply on.
    type: str

show_diff:
    default: false
    description:
    - Whether to print file changes details
    type: bool

skip_tags:
    description:
    - A list of puppet tags to be excluded.
    elements: str
    type: list
    version_added: 6.6.0
    version_added_collection: community.general

summarize:
    default: false
    description:
    - Whether to print a transaction summary.
    type: bool

modulepath:
    description:
    - Path to an alternate location for puppet modules.
    type: str

environment:
    description:
    - Puppet environment to be used.
    type: str

puppetmaster:
    description:
    - The hostname of the puppetmaster to contact.
    type: str

facter_basename:
    default: ansible
    description:
    - Basename of the facter output file.
    type: str

use_srv_records:
    description:
    - Toggles use_srv_records flag
    type: bool