Skip to content

Commit

Permalink
Merge pull request ansible#5127 from ovcharenko/patches
Browse files Browse the repository at this point in the history
synchronize module: Added existing_only options to skip creating new files on receiver
  • Loading branch information
jctanner committed Feb 5, 2014
2 parents 0a0e981 + c57445c commit 825a207
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions library/files/synchronize
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ options:
choices: [ 'yes', 'no' ]
default: 'yes'
required: false
existing_only:
description:
- Skip creating new files on receiver.
choices: [ 'yes', 'no' ]
default: 'no'
required: false
version_added: "1.5"
delete:
description:
- Delete files that don't exist (after transfer, not before) in the C(src) path.
Expand Down Expand Up @@ -166,6 +173,7 @@ def main():
private_key = dict(default=None),
rsync_path = dict(default=None),
archive = dict(default='yes', type='bool'),
existing_only = dict(default='no', type='bool'),
dirs = dict(default='no', type='bool'),
recursive = dict(type='bool'),
links = dict(type='bool'),
Expand All @@ -188,6 +196,7 @@ def main():
rsync = module.params.get('local_rsync_path', 'rsync')
rsync_timeout = module.params.get('rsync_timeout', 'rsync_timeout')
archive = module.params['archive']
existing_only = module.params['existing_only']
dirs = module.params['dirs']
# the default of these params depends on the value of archive
recursive = module.params['recursive']
Expand All @@ -203,6 +212,8 @@ def main():
cmd = cmd + ' --dry-run'
if delete:
cmd = cmd + ' --delete-after'
if existing_only:
cmd = cmd + ' --existing'
if archive:
cmd = cmd + ' --archive'
if recursive is False:
Expand Down

0 comments on commit 825a207

Please sign in to comment.