Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
bb3ce0c7
Commit
bb3ce0c7
authored
Apr 11, 2014
by
jctanner
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6702 from jjshoe/devel
Allow you to pass in arbitrary rsync options
parents
dfdc3b82
d57910b9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletions
+12
-1
library/files/synchronize
+12
-1
No files found.
library/files/synchronize
View file @
bb3ce0c7
...
@@ -131,6 +131,10 @@ options:
...
@@ -131,6 +131,10 @@ options:
- put user@ for the remote paths. If you have a custom ssh config to define the remote user for a host
- put user@ for the remote paths. If you have a custom ssh config to define the remote user for a host
that does not match the inventory user, you should set this parameter to "no".
that does not match the inventory user, you should set this parameter to "no".
default: yes
default: yes
rsync_opts:
description:
- Specify additional rsync options by passing in an array. (added in Ansible 1.6)
default:
required: false
required: false
notes:
notes:
- Inspect the verbose output to validate the destination user/host/path
- Inspect the verbose output to validate the destination user/host/path
...
@@ -183,6 +187,9 @@ synchronize: src=some/relative/path dest=/some/absolute/path rsync_path="sudo rs
...
@@ -183,6 +187,9 @@ synchronize: src=some/relative/path dest=/some/absolute/path rsync_path="sudo rs
- var # exclude any path whose last part is 'var'
- var # exclude any path whose last part is 'var'
- /var # exclude any path starting with 'var' starting at the source directory
- /var # exclude any path starting with 'var' starting at the source directory
+ /var/conf # include /var/conf even though it was previously excluded
+ /var/conf # include /var/conf even though it was previously excluded
# Synchronize passing in extra rsync options
synchronize: src=/tmp/helloworld dest=/var/www/helloword rsync_opts=--no-motd,--exclude=.git
'''
'''
...
@@ -207,7 +214,8 @@ def main():
...
@@ -207,7 +214,8 @@ def main():
owner
=
dict
(
type
=
'bool'
),
owner
=
dict
(
type
=
'bool'
),
group
=
dict
(
type
=
'bool'
),
group
=
dict
(
type
=
'bool'
),
set_remote_user
=
dict
(
default
=
'yes'
,
type
=
'bool'
),
set_remote_user
=
dict
(
default
=
'yes'
,
type
=
'bool'
),
rsync_timeout
=
dict
(
type
=
'int'
,
default
=
10
)
rsync_timeout
=
dict
(
type
=
'int'
,
default
=
10
),
rsync_opts
=
dict
(
type
=
'list'
)
),
),
supports_check_mode
=
True
supports_check_mode
=
True
)
)
...
@@ -232,6 +240,7 @@ def main():
...
@@ -232,6 +240,7 @@ def main():
times
=
module
.
params
[
'times'
]
times
=
module
.
params
[
'times'
]
owner
=
module
.
params
[
'owner'
]
owner
=
module
.
params
[
'owner'
]
group
=
module
.
params
[
'group'
]
group
=
module
.
params
[
'group'
]
rsync_opts
=
module
.
params
[
'rsync_opts'
]
cmd
=
'
%
s --delay-updates -FF --compress --timeout=
%
s'
%
(
rsync
,
rsync_timeout
)
cmd
=
'
%
s --delay-updates -FF --compress --timeout=
%
s'
%
(
rsync
,
rsync_timeout
)
if
module
.
check_mode
:
if
module
.
check_mode
:
...
@@ -289,6 +298,8 @@ def main():
...
@@ -289,6 +298,8 @@ def main():
if
rsync_path
:
if
rsync_path
:
cmd
=
cmd
+
" --rsync-path '
%
s'"
%
(
rsync_path
)
cmd
=
cmd
+
" --rsync-path '
%
s'"
%
(
rsync_path
)
if
rsync_opts
:
cmd
=
cmd
+
" "
+
" "
.
join
(
rsync_opts
)
changed_marker
=
'<<CHANGED>>'
changed_marker
=
'<<CHANGED>>'
cmd
=
cmd
+
" --out-format='"
+
changed_marker
+
"
%
i
%
n
%
L'"
cmd
=
cmd
+
" --out-format='"
+
changed_marker
+
"
%
i
%
n
%
L'"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment