From fd95dcade203087db74bd036ff0f4f80210a2250 Mon Sep 17 00:00:00 2001 From: Mandar Kulkarni Date: Mon, 12 Jul 2021 10:21:36 -0700 Subject: [PATCH] Fix: moving conditional to correct place --- plugins/modules/synchronize.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/modules/synchronize.py b/plugins/modules/synchronize.py index 23db5fb..7bca717 100644 --- a/plugins/modules/synchronize.py +++ b/plugins/modules/synchronize.py @@ -191,6 +191,7 @@ options: - This specifies rsync quiet option which on yes/true suppresses the non-error messages type: bool default: no + version_added: '1.3.0' notes: - rsync must be installed on both the local and remote host. @@ -602,6 +603,9 @@ def main(): cmd.append(shlex_quote(source)) cmd.append(shlex_quote(dest)) + if quiet: + cmd.append('--quiet') + cmdstr = ' '.join(cmd) # If we are using password authentication, write the password into the pipe @@ -621,9 +625,6 @@ def main(): else: (rc, out, err) = module.run_command(cmdstr) - if quiet: - cmd.append('--quiet') - if rc: return module.fail_json(msg=err, rc=rc, cmd=cmdstr)