From 62ff263ac1204a35a693e2f30e4bbe95cdb37c21 Mon Sep 17 00:00:00 2001 From: Ge0rgi0s <34042518+Ge0rgi0s@users.noreply.github.com> Date: Mon, 6 Jun 2022 10:32:20 +0200 Subject: [PATCH] Add puppet confdir option (#4740) * Add puppet confdir option * Add puppet confdir option change fragment * Improve quoting in plugins/modules/system/puppet.py Co-authored-by: Felix Fontein * Add version_added to plugins/modules/system/puppet.py Co-authored-by: Felix Fontein Co-authored-by: Georg Vogt Co-authored-by: Felix Fontein --- changelogs/fragments/4740-puppet-feature.yaml | 2 ++ plugins/modules/system/puppet.py | 8 ++++++++ 2 files changed, 10 insertions(+) create mode 100644 changelogs/fragments/4740-puppet-feature.yaml diff --git a/changelogs/fragments/4740-puppet-feature.yaml b/changelogs/fragments/4740-puppet-feature.yaml new file mode 100644 index 0000000000..a4341f42b8 --- /dev/null +++ b/changelogs/fragments/4740-puppet-feature.yaml @@ -0,0 +1,2 @@ +minor_changes: +- puppet - adds ``confdir`` parameter to configure a custom confir location (https://github.com/ansible-collections/community.general/pull/4740). diff --git a/plugins/modules/system/puppet.py b/plugins/modules/system/puppet.py index ed7341cb94..87fcc6e822 100644 --- a/plugins/modules/system/puppet.py +++ b/plugins/modules/system/puppet.py @@ -51,6 +51,11 @@ options: description: - Puppet environment to be used. type: str + confdir: + description: + - Path to the directory containing the puppet.conf file. + type: str + version_added: 5.1.0 logdest: description: - Where the puppet logs should go, if puppet apply is being used. @@ -179,6 +184,7 @@ def main(): puppetmaster=dict(type='str'), modulepath=dict(type='str'), manifest=dict(type='str'), + confdir=dict(type='str'), noop=dict(type='bool'), logdest=dict(type='str', default='stdout', choices=['all', 'stdout', 'syslog']), # The following is not related to Ansible's diff; see https://github.com/ansible-collections/community.general/pull/3980#issuecomment-1005666154 @@ -255,6 +261,8 @@ def main(): cmd += " --server %s" % shlex_quote(p['puppetmaster']) if p['show_diff']: cmd += " --show_diff" + if p['confdir']: + cmd += " --confdir %s" % shlex_quote(p['confdir']) if p['environment']: cmd += " --environment '%s'" % p['environment'] if p['tags']: