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

pull/18777/head
Michael Scherer 9 years ago committed by Matt Clay
parent a7b843ca80
commit ad54180d17

@ -144,7 +144,9 @@ class RabbitMqUser(object):
def _exec(self, args, run_in_check_mode=False): 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): 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) rc, out, err = self.module.run_command(cmd + args, check_rc=True)
return out.splitlines() return out.splitlines()
return list() return list()
@ -235,7 +237,7 @@ def main():
read_priv=dict(default='^$'), read_priv=dict(default='^$'),
force=dict(default='no', type='bool'), force=dict(default='no', type='bool'),
state=dict(default='present', choices=['present', 'absent']), state=dict(default='present', choices=['present', 'absent']),
node=dict(default='rabbit') node=dict(default=None)
) )
module = AnsibleModule( module = AnsibleModule(
argument_spec=arg_spec, argument_spec=arg_spec,

Loading…
Cancel
Save