From 1e0654f8b652c5fe77188670fe6b04b6d203f5a2 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 8b57cee..c856354 100644 --- a/plugins/modules/synchronize.py +++ b/plugins/modules/synchronize.py @@ -208,6 +208,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. @@ -615,6 +616,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 @@ -634,9 +638,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)