community.general.puppet 模块 – 运行 puppet
注意
此模块是 community.general 集合 (版本 10.1.0) 的一部分。
如果您使用的是 ansible
包,则可能已经安装了此集合。它不包含在 ansible-core
中。要检查它是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用: ansible-galaxy collection install community.general
。您需要其他要求才能使用此模块,有关详细信息,请参见 需求。
要在 playbook 中使用它,请指定: community.general.puppet
。
概要
以可靠的方式运行
puppet
代理或应用。
需求
以下需求是在执行此模块的主机上所需的。
puppet
参数
参数 |
注释 |
---|---|
处理证书时要使用的名称。 |
|
包含 puppet.conf 文件的目录的路径。 |
|
启用完全调试。 选项
|
|
要使用的 Puppet 环境。 |
|
运行 puppet 代理时要使用的 lang 环境。 默认值 如果出现问题,请使用 从 community.general 9.1.0 开始,您可以使用值 默认值: |
|
执行特定的 Puppet 代码片段。 它对 puppetmaster 没有影响。 |
|
facter 输出文件的基名。 默认值: |
|
要作为持久性外部 facter 事实传入的值的字典。 |
|
如果正在使用 puppet apply,则 puppet 日志应保存到的位置。
选项
|
|
要运行 puppet apply 的清单文件的路径。 |
|
Puppet 模块的备用位置的路径。 |
|
覆盖 puppet.conf noop 模式。 当 当 当未设置(默认)时,如果已定义,则使用默认值或 puppet.conf 值。 选项
|
|
要联系的 puppetmaster 的主机名。 |
|
是否打印文件更改详细信息 选项
|
|
要排除的 puppet 标签列表。 |
|
是否打印事务摘要。 选项
|
|
要使用的 puppet 标签列表。 |
|
等待 默认值: |
|
切换 use_srv_records 标志 选项
|
|
打印额外信息。 选项
|
|
在启动之前, 如果提供的是不带单位的数字,则假定为秒数。允许的单位是 |
属性
属性 |
支持 |
描述 |
---|---|---|
支持:完全支持 |
可以在 |
|
支持:不支持 |
在差异模式下,将返回有关已更改内容(或在 |
示例
- 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
skip_tags:
- service
- name: Wait 30 seconds for any current puppet runs to finish
community.general.puppet:
waitforlock: 30
- name: Wait 5 minutes for any current puppet runs to finish
community.general.puppet:
waitforlock: 5m
- name: Run puppet agent in noop mode
community.general.puppet:
noop: true
- 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