Do not use a default value for -n parameter, fix #1400 (#1417)

This commit is contained in:
Michael Scherer 2016-04-14 23:44:28 +02:00 committed by René Moser
parent bd0deed367
commit 84ca3ba7ee

View file

@ -144,7 +144,9 @@ class RabbitMqUser(object):
def _exec(self, args, run_in_check_mode=False):
if not self.module.check_mode or (self.module.check_mode and run_in_check_mode):
cmd = [self._rabbitmqctl, '-q', '-n', self.node]
cmd = [self._rabbitmqctl, '-q']
if self.node is not None:
cmd.append(['-n', self.node])
rc, out, err = self.module.run_command(cmd + args, check_rc=True)
return out.splitlines()
return list()
@ -235,7 +237,7 @@ def main():
read_priv=dict(default='^$'),
force=dict(default='no', type='bool'),
state=dict(default='present', choices=['present', 'absent']),
node=dict(default='rabbit')
node=dict(default=None)
)
module = AnsibleModule(
argument_spec=arg_spec,