|
|
@ -59,6 +59,11 @@ options:
|
|
|
|
- Basename of the facter output file
|
|
|
|
- Basename of the facter output file
|
|
|
|
required: false
|
|
|
|
required: false
|
|
|
|
default: ansible
|
|
|
|
default: ansible
|
|
|
|
|
|
|
|
environment:
|
|
|
|
|
|
|
|
desciption:
|
|
|
|
|
|
|
|
- Puppet environment to be used.
|
|
|
|
|
|
|
|
required: false
|
|
|
|
|
|
|
|
default: None
|
|
|
|
requirements: [ puppet ]
|
|
|
|
requirements: [ puppet ]
|
|
|
|
author: Monty Taylor
|
|
|
|
author: Monty Taylor
|
|
|
|
'''
|
|
|
|
'''
|
|
|
@ -69,6 +74,9 @@ EXAMPLES = '''
|
|
|
|
|
|
|
|
|
|
|
|
# Run puppet and timeout in 5 minutes
|
|
|
|
# Run puppet and timeout in 5 minutes
|
|
|
|
- puppet: timeout=5m
|
|
|
|
- puppet: timeout=5m
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Run puppet using a different environment
|
|
|
|
|
|
|
|
- puppet: environment=testing
|
|
|
|
'''
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -104,6 +112,7 @@ def main():
|
|
|
|
default=False, aliases=['show-diff'], type='bool'),
|
|
|
|
default=False, aliases=['show-diff'], type='bool'),
|
|
|
|
facts=dict(default=None),
|
|
|
|
facts=dict(default=None),
|
|
|
|
facter_basename=dict(default='ansible'),
|
|
|
|
facter_basename=dict(default='ansible'),
|
|
|
|
|
|
|
|
environment=dict(required=False, default=None),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
supports_check_mode=True,
|
|
|
|
supports_check_mode=True,
|
|
|
|
required_one_of=[
|
|
|
|
required_one_of=[
|
|
|
@ -154,12 +163,16 @@ def main():
|
|
|
|
puppetmaster=pipes.quote(p['puppetmaster']))
|
|
|
|
puppetmaster=pipes.quote(p['puppetmaster']))
|
|
|
|
if p['show_diff']:
|
|
|
|
if p['show_diff']:
|
|
|
|
cmd += " --show-diff"
|
|
|
|
cmd += " --show-diff"
|
|
|
|
|
|
|
|
if p['environment']:
|
|
|
|
|
|
|
|
cmd += " --environment '%s'" % p['environment']
|
|
|
|
if module.check_mode:
|
|
|
|
if module.check_mode:
|
|
|
|
cmd += " --noop"
|
|
|
|
cmd += " --noop"
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
cmd += " --no-noop"
|
|
|
|
cmd += " --no-noop"
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
cmd = "%s apply --detailed-exitcodes " % base_cmd
|
|
|
|
cmd = "%s apply --detailed-exitcodes " % base_cmd
|
|
|
|
|
|
|
|
if p['environment']:
|
|
|
|
|
|
|
|
cmd += "--environment '%s' " % p['environment']
|
|
|
|
if module.check_mode:
|
|
|
|
if module.check_mode:
|
|
|
|
cmd += "--noop "
|
|
|
|
cmd += "--noop "
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|