mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Add support for specifying the modulepath for the Puppet module (#24122)
Puppet modules are not always installed in the default location (i.e, /etc/puppet/modules) so it is useful to be able to specify an alternate location.
This commit is contained in:
parent
1c11a35f70
commit
b95fefd8f5
1 changed files with 10 additions and 0 deletions
|
@ -38,6 +38,12 @@ options:
|
||||||
- The hostname of the puppetmaster to contact.
|
- The hostname of the puppetmaster to contact.
|
||||||
required: false
|
required: false
|
||||||
default: None
|
default: None
|
||||||
|
modulepath:
|
||||||
|
description:
|
||||||
|
- Path to an alternate location for puppet modules
|
||||||
|
required: false
|
||||||
|
default: None
|
||||||
|
version_added: "2.4"
|
||||||
manifest:
|
manifest:
|
||||||
description:
|
description:
|
||||||
- Path to the manifest file to run puppet apply on.
|
- Path to the manifest file to run puppet apply on.
|
||||||
|
@ -155,6 +161,7 @@ def main():
|
||||||
argument_spec=dict(
|
argument_spec=dict(
|
||||||
timeout=dict(default="30m"),
|
timeout=dict(default="30m"),
|
||||||
puppetmaster=dict(required=False, default=None),
|
puppetmaster=dict(required=False, default=None),
|
||||||
|
modulepath=dict(required=False, default=None),
|
||||||
manifest=dict(required=False, default=None),
|
manifest=dict(required=False, default=None),
|
||||||
logdest=dict(
|
logdest=dict(
|
||||||
required=False, default='stdout',
|
required=False, default='stdout',
|
||||||
|
@ -173,6 +180,7 @@ def main():
|
||||||
mutually_exclusive=[
|
mutually_exclusive=[
|
||||||
('puppetmaster', 'manifest'),
|
('puppetmaster', 'manifest'),
|
||||||
('puppetmaster', 'manifest', 'execute'),
|
('puppetmaster', 'manifest', 'execute'),
|
||||||
|
('puppetmaster', 'modulepath')
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
p = module.params
|
p = module.params
|
||||||
|
@ -243,6 +251,8 @@ def main():
|
||||||
cmd = "%s apply --detailed-exitcodes " % base_cmd
|
cmd = "%s apply --detailed-exitcodes " % base_cmd
|
||||||
if p['logdest'] == 'syslog':
|
if p['logdest'] == 'syslog':
|
||||||
cmd += "--logdest syslog "
|
cmd += "--logdest syslog "
|
||||||
|
if p['modulepath']:
|
||||||
|
cmd += "--modulepath='%s'" % p['modulepath']
|
||||||
if p['environment']:
|
if p['environment']:
|
||||||
cmd += "--environment '%s' " % p['environment']
|
cmd += "--environment '%s' " % p['environment']
|
||||||
if p['certname']:
|
if p['certname']:
|
||||||
|
|
Loading…
Add table
Reference in a new issue