Revert "Sync puppet module changes from upstream ansible"
This reverts commit 1c69c305e7
.
This may have caused the ansible apply test to fail (and therefore
potentially puppet runs from our puppetmaster). It's difficult
to tell because we don't run that test on this repo.
Change-Id: I37a82ba50875e8c984e4bede4e85cae65de7bd62
This commit is contained in:
parent
e7a06ed55a
commit
66a64e7510
|
@ -73,37 +73,18 @@ options:
|
|||
required: false
|
||||
default: stdout
|
||||
version_added: "2.1"
|
||||
certname:
|
||||
description:
|
||||
- The name to use when handling certificates.
|
||||
required: false
|
||||
default: None
|
||||
version_added: "2.1"
|
||||
tags:
|
||||
description:
|
||||
- A comma-separated list of puppet tags to be used.
|
||||
required: false
|
||||
default: None
|
||||
version_added: "2.1"
|
||||
execute:
|
||||
description:
|
||||
- Execute a specific piece of Puppet code. It has no effect with
|
||||
a puppetmaster.
|
||||
required: false
|
||||
default: None
|
||||
version_added: "2.1"
|
||||
noop:
|
||||
description:
|
||||
- Whether puppet should be run in noop mode
|
||||
required: false
|
||||
default: false
|
||||
version_added: "2.2"
|
||||
version_added: "2.1"
|
||||
debug:
|
||||
description:
|
||||
- Whether puppet should be run in debug mode
|
||||
required: false
|
||||
default: false
|
||||
version_added: "2.2"
|
||||
version_added: "2.1"
|
||||
|
||||
requirements: [ puppet ]
|
||||
author: "Monty Taylor (@emonty)"
|
||||
|
@ -118,15 +99,6 @@ EXAMPLES = '''
|
|||
|
||||
# Run puppet using a different environment
|
||||
- puppet: environment=testing
|
||||
|
||||
# Run puppet using a specific certname
|
||||
- puppet: certname=agent01.example.com
|
||||
# Run puppet using a specific piece of Puppet code. Has no effect with a
|
||||
# puppetmaster.
|
||||
- puppet: execute='include ::mymodule'
|
||||
|
||||
# Run puppet using a specific tags
|
||||
- puppet: tags=update,nginx
|
||||
'''
|
||||
|
||||
|
||||
|
@ -166,22 +138,18 @@ def main():
|
|||
facts=dict(default=None),
|
||||
facter_basename=dict(default='ansible'),
|
||||
environment=dict(required=False, default=None),
|
||||
certname=dict(required=False, default=None),
|
||||
tags=dict(required=False, default=None, type='list'),
|
||||
execute=dict(required=False, default=None),
|
||||
noop=dict(required=False, default=False, type='bool'),
|
||||
debug=dict(required=False, default=False, type='bool'),
|
||||
),
|
||||
supports_check_mode=True,
|
||||
mutually_exclusive=[
|
||||
('puppetmaster', 'manifest'),
|
||||
('puppetmaster', 'manifest', 'execute'),
|
||||
],
|
||||
)
|
||||
p = module.params
|
||||
|
||||
global PUPPET_CMD
|
||||
PUPPET_CMD = module.get_bin_path("puppet", False, ['/opt/puppetlabs/bin'])
|
||||
PUPPET_CMD = module.get_bin_path("puppet", False)
|
||||
|
||||
if not PUPPET_CMD:
|
||||
module.fail_json(
|
||||
|
@ -225,7 +193,7 @@ def main():
|
|||
if not p['manifest']:
|
||||
cmd = ("%(base_cmd)s agent --onetime"
|
||||
" --ignorecache --no-daemonize --no-usecacheonfailure"
|
||||
" --no-splay --verbose --color 0") % dict(
|
||||
" --no-splay --verbose") % dict(
|
||||
base_cmd=base_cmd,
|
||||
)
|
||||
if p['puppetmaster']:
|
||||
|
@ -239,10 +207,6 @@ def main():
|
|||
cmd += " --show_diff"
|
||||
if p['environment']:
|
||||
cmd += " --environment '%s'" % p['environment']
|
||||
if p['tags']:
|
||||
cmd += " --tags '%s'" % ','.join(p['tags'])
|
||||
if p['certname']:
|
||||
cmd += " --certname='%s'" % p['certname']
|
||||
if module.check_mode or p['noop']:
|
||||
# Noop causes detailed-exitcodes to sometimes erroneously
|
||||
# return failures, so we only set detailed-exitcodes when
|
||||
|
@ -256,7 +220,7 @@ def main():
|
|||
|
||||
if rc == 0:
|
||||
# success
|
||||
module.exit_json(rc=rc, changed=False, stdout=stdout, stderr=stderr)
|
||||
module.exit_json(rc=rc, changed=False, stdout=stdout)
|
||||
elif rc == 1:
|
||||
# rc==1 could be because it's disabled
|
||||
# rc==1 could also mean there was a compilation failure
|
||||
|
|
Loading…
Reference in New Issue