From 8d7c8302262e3ac3c8e52cd3176d237bd7fc8eb3 Mon Sep 17 00:00:00 2001 From: Esa Varemo Date: Fri, 3 Apr 2020 23:26:36 +0300 Subject: [PATCH] puppet: fix check-mode Commit 69ead0ba7864b1e7367eb9755b51d30ecc0da0d2 in the ansible/ansible repository introduced another if-statement in the middle of a if/elif pair, which causes the elif to execute together with the original if which created '--noop --no-noop' commands --- plugins/modules/system/puppet.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/modules/system/puppet.py b/plugins/modules/system/puppet.py index 8efe2c85d7..0b12d6ca46 100644 --- a/plugins/modules/system/puppet.py +++ b/plugins/modules/system/puppet.py @@ -255,16 +255,16 @@ def main(): cmd += " --certname='%s'" % p['certname'] if module.check_mode: cmd += " --noop" - if p['use_srv_records'] is not None: - if not p['use_srv_records']: - cmd += " --no-use_srv_records" - else: - cmd += " --use_srv_records" elif 'noop' in p: if p['noop']: cmd += " --noop" else: cmd += " --no-noop" + if p['use_srv_records'] is not None: + if not p['use_srv_records']: + cmd += " --no-use_srv_records" + else: + cmd += " --use_srv_records" else: cmd = "%s apply --detailed-exitcodes " % base_cmd if p['logdest'] == 'syslog':