From 9f170f579a9f49658674750a12dbcf78b2f1602e Mon Sep 17 00:00:00 2001 From: Timothy Appnel Date: Mon, 10 Jun 2013 19:21:36 -0400 Subject: [PATCH 1/7] Introduced ansible-rsync to core. --- .../runner/action_plugins/synchronize.py | 102 +++++++++++++ library/network/synchronize | 137 ++++++++++++++++++ 2 files changed, 239 insertions(+) create mode 100644 lib/ansible/runner/action_plugins/synchronize.py create mode 100644 library/network/synchronize diff --git a/lib/ansible/runner/action_plugins/synchronize.py b/lib/ansible/runner/action_plugins/synchronize.py new file mode 100644 index 00000000000..a4f7f3610cb --- /dev/null +++ b/lib/ansible/runner/action_plugins/synchronize.py @@ -0,0 +1,102 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# (c) 2012-2013, Timothy Appnel +# +# Ansible is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Ansible is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Ansible. If not, see . + +import os.path + +from ansible import utils +from ansible.runner.return_data import ReturnData + +class ActionModule(object): + + def __init__(self, runner): + self.runner = runner + + def _process_origin( + self, + host, + path, + user, + ): + + if not host in ['127.0.0.1', 'localhost']: + return '%s@%s:%s' % (user, host, path) + else: + return path + + def run( + self, + conn, + tmp, + module_name, + module_args, + inject, + complex_args=None, + **kwargs + ): + ''' generates params and passes them on to the rsync module ''' + + # load up options + + options = {} + if complex_args: + options.update(complex_args) + options.update(utils.parse_kv(module_args)) + + src = options.get('src', None) + dest = options.get('dest', None) + + try: + options['local_rsync_path'] = inject['ansible_rsync_path'] + except KeyError: + pass + + dest_host = inject.get('delegate_to', + inject.get('ansible_ssh_host')) + if dest_host is None: + dest_host = inject['inventory_hostname'] + if dest_host in ['localhost', '127.0.0.1']: + dest_host = '127.0.0.1' + src_host = '127.0.0.1' # inventory_hostname is localhost when transport not local + if options.get('mode', 'push') == 'pull': + (dest_host, src_host) = (src_host, dest_host) + if not dest_host is src_host: + user = inject.get('ansible_ssh_user', + self.runner.remote_user) + + # should we support ssh_password and ssh_port here?? + + options['private_key'] = \ + inject.get('ansible_ssh_private_key_file', + self.runner.private_key_file) + src = self._process_origin(src_host, src, user) + dest = self._process_origin(dest_host, dest, user) + + options['src'] = src + options['dest'] = dest + try: + del options['mode'] + except KeyError: + pass + + # run the synchronize module + + self.runner.module_args = ' '.join(['%s=%s' % (k, v) for (k, + v) in options.items()]) + return self.runner._execute_module(conn, tmp, 'synchronize', + self.runner.module_args, inject=inject) + diff --git a/library/network/synchronize b/library/network/synchronize new file mode 100644 index 00000000000..fd979b74074 --- /dev/null +++ b/library/network/synchronize @@ -0,0 +1,137 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# (c) 2012-2013, Timothy Appnel +# +# Ansible is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Ansible is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Ansible. If not, see . + +import subprocess + +DOCUMENTATION = \ + ''' +--- +module: synchronize +short_description: An Ansible action plugin using rsync to make synchronizing a file paths in your playbooks quick and easy. +description: + - An Ansible action plugin using rsync to make synchronizing a file paths in your playbooks quick and easy. Of course you could just use the command action to call rsync yourself, but you also have to add a fair number of boilerplate options and host facts. You still may need to call rsync directly via C(command) or C(shell). The synchronize action is meant to do common things with C(rsync) easily. It does not provide access to the full power of rsync. +options: + src: + description: + - Path on the source machine that will be synchronized to the destination; The path can be absolute or relative. + required: true + default: null + dest: + description: + - Path on the destination machine that will be synchronized from the source; The path can be absolute or relative. + required: true + default: null + mode: + description: + - Specify the direction of the synchroniztion. In push mode the localhost or delgate is the source; In pull mode the inventory hostname in context is the source. + required: false + choices: [ 'push', 'pull' ] + default: 'push' + verbosity: + description: + - An integrater controling the amount of information returned during processing. The greater the value the more information rsync will report back. See the C(-v, --verbose) option of the rsync man page for details. If verbosity is not defined or a value of 0 is assumed, the C(--quiet) option is passed and information is supressed. + required: false + default: 0 + delete: + description: + - Delete files that don't exist (after transfer, not before) in C(src) path. + choices: [ 'yes', 'no' ] + default: 'no' + required: false + rsync_path: + description: + - Specify rsync to run on the remote machine. See C(--rsync-path) on the rsync man page. + required: false + default: null +examples: + - code: 'synchronize: src=some/relative/path dest=/some/absolute/path' + description: Synchronization of src on the localhost to dest on the current inventory host + - code: 'local_action: synchronize src=some/relative/path dest=/some/absolute/path' + description: Synchronization of src path to dest path on the localhost + - code: 'synchronize: mode=pull src=some/relative/path dest=/some/absolute/path' + description: Synchronization of src on the inventory host to the dest on the localhost. + - code: | + synchronize: src=some/relative/path dest=/some/absolute/path + delegate_to: delegate.host + description: Synchronization of src on delegate to dest on the current inventory host + - code: 'synchronize: src=some/relative/path dest=/some/absolute/path delete=yes' + description: 'Synchronize and delete files in dest on inventory host not found in src of localhost.' + - code: 'synchronize: src=some/relative/path dest=/some/absolute/path verbosity=1' + description: 'Synchronize and return verbose information from the rsync transfer.' + - code: 'synchronize: src=some/relative/path dest=/some/absolute/path rsync_path="sudo rsync"' + description: 'Synchronize with using an alternate rsync command.' +author: Timothy Appnel +''' + + +def main(): + module = AnsibleModule(argument_spec=dict( + src=dict(required=True), + dest=dict(required=True), + verbosity=dict(default=0), + tmp_dir=dict(default=None), + delete=dict(default='no', choices=['yes', 'no']), + private_key=dict(default=None), + rsync_path=dict(default=None), + )) + + source = module.params['src'] + dest = module.params['dest'] + verbosity = module.params['verbosity'] + delete = module.params['delete'] + private_key = module.params['private_key'] + rsync_path = module.params['rsync_path'] + rsync = module.params.get('local_rsync_path', 'rsync') + temp = os.path.dirname(os.path.realpath(__file__)) + + if not private_key and ('@' in dest or '@' in source): + return module.fail_json(msg='A private key is required for remote connections.' + ) + + cmd = '%s --archive --delay-updates --compress' % rsync + if verbosity: + cmd = '%s -%s' % (cmd, 'v' * int(verbosity)) + else: + cmd = cmd + ' --quiet' + if temp: + cmd = cmd + ' --temp-dir ' + temp + if module.boolean(delete): + cmd = cmd + ' --delete-after' + if private_key: + cmd = cmd + " --rsh '%s -i %s -o %s'" % ('ssh', private_key, + 'StrictHostKeyChecking=no') # need ssh param + if rsync_path: + cmd = cmd + ' --rsync-path ' + rsync_path + + cmd = ' '.join([cmd, source, dest]) + cmdstr = cmd + cmd = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + (out, err) = cmd.communicate() + if cmd.returncode: + return module.fail_json(msg=err, rc=cmd.returncode, cmd=cmdstr) + else: + return module.exit_json(changed=True, msg=out, + rc=cmd.returncode, cmd=cmdstr) + + +# include magic from lib/ansible/module_common.py +#<> + +main() + From adbca9d251b7b6477cc6ec5d7ad2feb4b8aec455 Mon Sep 17 00:00:00 2001 From: Timothy Appnel Date: Thu, 11 Jul 2013 20:08:46 -0400 Subject: [PATCH 2/7] Fixed identity key logic. --- lib/ansible/runner/action_plugins/synchronize.py | 7 +++---- library/network/synchronize | 11 +++++------ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/lib/ansible/runner/action_plugins/synchronize.py b/lib/ansible/runner/action_plugins/synchronize.py index a4f7f3610cb..337f6cf799d 100644 --- a/lib/ansible/runner/action_plugins/synchronize.py +++ b/lib/ansible/runner/action_plugins/synchronize.py @@ -77,12 +77,11 @@ class ActionModule(object): if not dest_host is src_host: user = inject.get('ansible_ssh_user', self.runner.remote_user) - - # should we support ssh_password and ssh_port here?? - - options['private_key'] = \ + private_key = \ inject.get('ansible_ssh_private_key_file', self.runner.private_key_file) + if not private_key is None: + options['private_key'] = private_key src = self._process_origin(src_host, src, user) dest = self._process_origin(dest_host, dest, user) diff --git a/library/network/synchronize b/library/network/synchronize index fd979b74074..016abd3734e 100644 --- a/library/network/synchronize +++ b/library/network/synchronize @@ -99,10 +99,6 @@ def main(): rsync = module.params.get('local_rsync_path', 'rsync') temp = os.path.dirname(os.path.realpath(__file__)) - if not private_key and ('@' in dest or '@' in source): - return module.fail_json(msg='A private key is required for remote connections.' - ) - cmd = '%s --archive --delay-updates --compress' % rsync if verbosity: cmd = '%s -%s' % (cmd, 'v' * int(verbosity)) @@ -112,8 +108,11 @@ def main(): cmd = cmd + ' --temp-dir ' + temp if module.boolean(delete): cmd = cmd + ' --delete-after' - if private_key: - cmd = cmd + " --rsh '%s -i %s -o %s'" % ('ssh', private_key, + if private_key is None: + private_key = '' + else: + private_key = '-i '+ private_key + cmd = cmd + " --rsh '%s %s -o %s'" % ('ssh', private_key, 'StrictHostKeyChecking=no') # need ssh param if rsync_path: cmd = cmd + ' --rsync-path ' + rsync_path From 4a9635e04e367d1c1521afaed985ac747c30c8b8 Mon Sep 17 00:00:00 2001 From: Timothy Appnel Date: Mon, 29 Jul 2013 13:30:35 -0400 Subject: [PATCH 3/7] Straighten out local-remote-delegate logic in rsync action module. Force set delegate to local if one is not defined. --- lib/ansible/runner/action_plugins/synchronize.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/ansible/runner/action_plugins/synchronize.py b/lib/ansible/runner/action_plugins/synchronize.py index 337f6cf799d..4b505d06114 100644 --- a/lib/ansible/runner/action_plugins/synchronize.py +++ b/lib/ansible/runner/action_plugins/synchronize.py @@ -65,13 +65,12 @@ class ActionModule(object): except KeyError: pass - dest_host = inject.get('delegate_to', - inject.get('ansible_ssh_host')) - if dest_host is None: - dest_host = inject['inventory_hostname'] - if dest_host in ['localhost', '127.0.0.1']: - dest_host = '127.0.0.1' - src_host = '127.0.0.1' # inventory_hostname is localhost when transport not local + # the localhost is the default delegate in an rsync task + if inject.get('delegate_to') is None: + conn.delegate = '127.0.0.1' + inject['delegate_to'] = '127.0.0.1' + src_host = inject['delegate_to'] + dest_host = inject.get('ansible_ssh_host', inject['inventory_hostname']) if options.get('mode', 'push') == 'pull': (dest_host, src_host) = (src_host, dest_host) if not dest_host is src_host: From 2288a11b6ad3db89f697020adc3ac0cb5f592083 Mon Sep 17 00:00:00 2001 From: Timothy Appnel Date: Mon, 29 Jul 2013 19:06:14 -0400 Subject: [PATCH 4/7] Implemented setup method in rsync action module. --- lib/ansible/runner/action_plugins/synchronize.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/ansible/runner/action_plugins/synchronize.py b/lib/ansible/runner/action_plugins/synchronize.py index 4b505d06114..fc6e70f4ab1 100644 --- a/lib/ansible/runner/action_plugins/synchronize.py +++ b/lib/ansible/runner/action_plugins/synchronize.py @@ -38,6 +38,11 @@ class ActionModule(object): else: return path + def setup(self, module_name, inject): + ''' Always default to localhost as delegate if None defined ''' + if inject.get('delegate_to') is None: + inject['delegate_to'] = '127.0.0.1' + def run( self, conn, @@ -65,10 +70,6 @@ class ActionModule(object): except KeyError: pass - # the localhost is the default delegate in an rsync task - if inject.get('delegate_to') is None: - conn.delegate = '127.0.0.1' - inject['delegate_to'] = '127.0.0.1' src_host = inject['delegate_to'] dest_host = inject.get('ansible_ssh_host', inject['inventory_hostname']) if options.get('mode', 'push') == 'pull': From f8c97d6e79a7bc5cf23136e763ac07032e3176fc Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Sat, 10 Aug 2013 18:58:45 -0400 Subject: [PATCH 5/7] Style/docs cleanup, and also improve an error message. --- lib/ansible/runner/__init__.py | 5 +- .../runner/action_plugins/synchronize.py | 28 ++----- library/{network => files}/synchronize | 80 ++++++++++--------- 3 files changed, 54 insertions(+), 59 deletions(-) rename library/{network => files}/synchronize (52%) diff --git a/lib/ansible/runner/__init__.py b/lib/ansible/runner/__init__.py index 7a5290f3c7a..7f9e18aa1c5 100644 --- a/lib/ansible/runner/__init__.py +++ b/lib/ansible/runner/__init__.py @@ -737,7 +737,10 @@ class Runner(object): # error handling on this seems a little aggressive? if result['rc'] != 0: - output = 'could not create temporary directory, SSH (%s) exited with result %d' % (cmd, result['rc']) + if result['rc'] == 5: + output = 'Authentication failure.' + else: + output = 'Authentication or permission failure. In some cases, you may have been able to authenticate and did not have permissions on the remote directory. Consider changing the remote temp path in ansible.cfg to a path rooted in "/tmp". Failed command was: %s, exited with result %d' % (cmd, result['rc']) if 'stdout' in result and result['stdout'] != '': output = output + ": %s" % result['stdout'] raise errors.AnsibleError(output) diff --git a/lib/ansible/runner/action_plugins/synchronize.py b/lib/ansible/runner/action_plugins/synchronize.py index fc6e70f4ab1..87264475da0 100644 --- a/lib/ansible/runner/action_plugins/synchronize.py +++ b/lib/ansible/runner/action_plugins/synchronize.py @@ -26,12 +26,7 @@ class ActionModule(object): def __init__(self, runner): self.runner = runner - def _process_origin( - self, - host, - path, - user, - ): + def _process_origin(self, host, path, user): if not host in ['127.0.0.1', 'localhost']: return '%s@%s:%s' % (user, host, path) @@ -43,16 +38,9 @@ class ActionModule(object): if inject.get('delegate_to') is None: inject['delegate_to'] = '127.0.0.1' - def run( - self, - conn, - tmp, - module_name, - module_args, - inject, - complex_args=None, - **kwargs - ): + def run(self, conn, tmp, module_name, module_args, + inject, complex_args=None, **kwargs): + ''' generates params and passes them on to the rsync module ''' # load up options @@ -77,9 +65,7 @@ class ActionModule(object): if not dest_host is src_host: user = inject.get('ansible_ssh_user', self.runner.remote_user) - private_key = \ - inject.get('ansible_ssh_private_key_file', - self.runner.private_key_file) + private_key = inject.get('ansible_ssh_private_key_file', self.runner.private_key_file) if not private_key is None: options['private_key'] = private_key src = self._process_origin(src_host, src, user) @@ -87,10 +73,8 @@ class ActionModule(object): options['src'] = src options['dest'] = dest - try: + if 'mode' in options: del options['mode'] - except KeyError: - pass # run the synchronize module diff --git a/library/network/synchronize b/library/files/synchronize similarity index 52% rename from library/network/synchronize rename to library/files/synchronize index 016abd3734e..fb28085abb8 100644 --- a/library/network/synchronize +++ b/library/files/synchronize @@ -22,73 +22,81 @@ DOCUMENTATION = \ ''' --- module: synchronize -short_description: An Ansible action plugin using rsync to make synchronizing a file paths in your playbooks quick and easy. +short_description: Uses rsync to make synchronizing file paths in your playbooks quick and easy. description: - - An Ansible action plugin using rsync to make synchronizing a file paths in your playbooks quick and easy. Of course you could just use the command action to call rsync yourself, but you also have to add a fair number of boilerplate options and host facts. You still may need to call rsync directly via C(command) or C(shell). The synchronize action is meant to do common things with C(rsync) easily. It does not provide access to the full power of rsync. + - This is a wrapper around rsync. Of course you could just use the command action to call rsync yourself, but you also have to add a fair number of boilerplate options and host facts. You still may need to call rsync directly via C(command) or C(shell) depending on your use case. The synchronize action is meant to do common things with C(rsync) easily. It does not provide access to the full power of rsync, but does make most invocations easier to follow. options: src: description: - Path on the source machine that will be synchronized to the destination; The path can be absolute or relative. required: true - default: null dest: description: - Path on the destination machine that will be synchronized from the source; The path can be absolute or relative. required: true - default: null mode: description: - - Specify the direction of the synchroniztion. In push mode the localhost or delgate is the source; In pull mode the inventory hostname in context is the source. + - Specify the direction of the synchroniztion. In push mode the localhost or delgate is the source; In pull mode the remote host in context is the source. required: false choices: [ 'push', 'pull' ] default: 'push' verbosity: description: - - An integrater controling the amount of information returned during processing. The greater the value the more information rsync will report back. See the C(-v, --verbose) option of the rsync man page for details. If verbosity is not defined or a value of 0 is assumed, the C(--quiet) option is passed and information is supressed. + - An integer controlling the amount of information returned during processing. See the C(-v, --verbose) option of the rsync man page for details. If verbosity is not defined or a value of 0 is assumed, the C(--quiet) option is passed and information is supressed. required: false default: 0 delete: description: - - Delete files that don't exist (after transfer, not before) in C(src) path. + - Delete files that don't exist (after transfer, not before) in the C(src) path. choices: [ 'yes', 'no' ] default: 'no' required: false rsync_path: description: - - Specify rsync to run on the remote machine. See C(--rsync-path) on the rsync man page. + - Specify the rsync command to run on the remote machine. See C(--rsync-path) on the rsync man page. required: false - default: null -examples: - - code: 'synchronize: src=some/relative/path dest=/some/absolute/path' - description: Synchronization of src on the localhost to dest on the current inventory host - - code: 'local_action: synchronize src=some/relative/path dest=/some/absolute/path' - description: Synchronization of src path to dest path on the localhost - - code: 'synchronize: mode=pull src=some/relative/path dest=/some/absolute/path' - description: Synchronization of src on the inventory host to the dest on the localhost. - - code: | - synchronize: src=some/relative/path dest=/some/absolute/path - delegate_to: delegate.host - description: Synchronization of src on delegate to dest on the current inventory host - - code: 'synchronize: src=some/relative/path dest=/some/absolute/path delete=yes' - description: 'Synchronize and delete files in dest on inventory host not found in src of localhost.' - - code: 'synchronize: src=some/relative/path dest=/some/absolute/path verbosity=1' - description: 'Synchronize and return verbose information from the rsync transfer.' - - code: 'synchronize: src=some/relative/path dest=/some/absolute/path rsync_path="sudo rsync"' - description: 'Synchronize with using an alternate rsync command.' author: Timothy Appnel ''' +EXAMPLES = ''' +# Synchronization of src on the control machien to dest on the remote hosts +synchronize: src=some/relative/path dest=/some/absolute/path + +# Synchronization of two paths both on the control machine +local_action: synchronize src=some/relative/path dest=/some/absolute/path + +# Synchronization of src on the inventory host to the dest on the localhost in +pull mode +synchronize: mode=pull src=some/relative/path dest=/some/absolute/path + +# Synchronization of src on delegate host to dest on the current inventory host +synchronize: > + src=some/relative/path dest=/some/absolute/path + delegate_to: delegate.host + +# Synchronize and delete files in dest on the remote host that are not found in src of localhost. +synchronize: src=some/relative/path dest=/some/absolute/path delete=yes + +# Synchronize and return verbose information from the rsync transfer. +synchronize: src=some/relative/path dest=/some/absolute/path verbosity=1 + +# Synchronize using an alternate rsync command +synchronize: src=some/relative/path dest=/some/absolute/path rsync_path="sudo rsync" +''' + def main(): - module = AnsibleModule(argument_spec=dict( - src=dict(required=True), - dest=dict(required=True), - verbosity=dict(default=0), - tmp_dir=dict(default=None), - delete=dict(default='no', choices=['yes', 'no']), - private_key=dict(default=None), - rsync_path=dict(default=None), - )) + module = AnsibleModule( + argument_spec = dict( + src = dict(required=True), + dest = dict(required=True), + verbosity = dict(default=0), + tmp_dir = dict(default=None), + delete = dict(default='no', type='bool'), + private_key = dict(default=None), + rsync_path = dict(default=None), + ) + ) source = module.params['src'] dest = module.params['dest'] @@ -106,7 +114,7 @@ def main(): cmd = cmd + ' --quiet' if temp: cmd = cmd + ' --temp-dir ' + temp - if module.boolean(delete): + if delete: cmd = cmd + ' --delete-after' if private_key is None: private_key = '' From db8d9a6ea7e9e961e3b5c2d12af6a08bbad39081 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Sat, 10 Aug 2013 19:03:00 -0400 Subject: [PATCH 6/7] Update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a1cec60d5ac..77fce40344b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ Highlighted new features: * added changed_when: (expression) which allows overriding whether a result is changed or not, can work with registered expressions. * --extra-vars can now take a file as input "-e @filename" * external inventory scripts may now return host variables in one pass, which allows them to be much for efficient for large numbers of hosts +* if --forks exceeds the numbers of hosts, it will be automatically reduced, set forks to 0 and you get "as many forks as I have hosts" out of the box. New modules: @@ -29,6 +30,7 @@ New modules: * packaging: rpm_key -- adds or removes RPM signing keys * monitoring: boundary_meter -- adds or removes boundary.com meters * net_infrastructure: dnsmadeeasy - manipulate DnsMadeEasy records +* files: synchronize -- a wrapper around making rsync easy to understand Misc changes: From cde87f2f5556a0effa8d4200088854bf9fc6af85 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Sun, 11 Aug 2013 16:21:00 -0400 Subject: [PATCH 7/7] Add missing version_added to docs. --- library/files/synchronize | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/files/synchronize b/library/files/synchronize index fb28085abb8..882f7d60723 100644 --- a/library/files/synchronize +++ b/library/files/synchronize @@ -18,10 +18,10 @@ import subprocess -DOCUMENTATION = \ - ''' +DOCUMENTATION = ''' --- module: synchronize +version_added: "1.3" short_description: Uses rsync to make synchronizing file paths in your playbooks quick and easy. description: - This is a wrapper around rsync. Of course you could just use the command action to call rsync yourself, but you also have to add a fair number of boilerplate options and host facts. You still may need to call rsync directly via C(command) or C(shell) depending on your use case. The synchronize action is meant to do common things with C(rsync) easily. It does not provide access to the full power of rsync, but does make most invocations easier to follow.