Class: Ansible::Ruby::Modules::Synchronize
- Inherits:
-
Base
- Object
- Ansible::Ruby::Models::Base
- Base
- Ansible::Ruby::Modules::Synchronize
- Defined in:
- lib/ansible/ruby/modules/generated/files/synchronize.rb
Overview
C(synchronize) is a wrapper around rsync to make common tasks in your playbooks quick and easy. It is run and originates on the local host where Ansible is being run. Of course, you could just use the C(command) action to call rsync yourself, but you also have to add a fair number of boilerplate options and host facts. C(synchronize) is not intended to provide access to the full power of rsync, but does make the most common invocations easier to implement. You ‘still` may need to call rsync directly via C(command) or C(shell) depending on your use case.
Instance Method Summary collapse
-
#archive ⇒ :yes, ...
Mirrors the rsync archive flag, enables recursive, links, perms, times, owner, group flags and -D.
-
#checksum ⇒ :yes, ...
Skip based on checksum, rather than mod-time & size; Note that that “archive” option is still enabled by default - the “checksum” option will not disable it.
-
#compress ⇒ :yes, ...
Compress file data during the transfer.
-
#copy_links ⇒ :yes, ...
Copy symlinks as the item that they point to (the referent) is copied, rather than the symlink.
-
#delete ⇒ :yes, ...
Delete files in C(dest) that don’t exist (after transfer, not before) in the C(src) path.
-
#dest ⇒ String
Path on the destination host that will be synchronized from the source; The path can be absolute or relative.
-
#dest_port ⇒ Array<String>, ...
Port number for ssh on the destination host.
-
#dirs ⇒ :yes, ...
Transfer directories without recursing.
-
#existing_only ⇒ :yes, ...
Skip creating new files on receiver.
-
#group ⇒ Symbol?
Preserve group.
-
#link_dest ⇒ String?
Add a destination to hard link against during the rsync.
-
#links ⇒ Symbol?
Copy symlinks as symlinks.
-
#mode ⇒ :pull, ...
Specify the direction of the synchronization.
-
#owner ⇒ Symbol?
Preserve owner (super user only).
-
#partial ⇒ :yes, ...
Tells rsync to keep the partial file which should make a subsequent transfer of the rest of the file much faster.
-
#perms ⇒ Symbol?
Preserve permissions.
-
#private_key ⇒ Object?
Specify the private key to use for SSH-based rsync connections (e.g. C(~/.ssh/id_rsa)).
-
#recursive ⇒ Symbol?
Recurse into directories.
-
#rsync_opts ⇒ Array<String>, ...
Specify additional rsync options by passing in an array.
-
#rsync_path ⇒ String?
Specify the rsync command to run on the remote host.
-
#rsync_timeout ⇒ Integer?
Specify a C(–timeout) for the rsync command in seconds.
-
#set_remote_user ⇒ Boolean?
Put user@ for the remote paths.
-
#src ⇒ String
Path on the source host that will be synchronized to the destination; The path can be absolute or relative.
-
#times ⇒ Symbol?
Preserve modification times.
-
#use_ssh_args ⇒ :yes, ...
Use the ssh_args specified in ansible.cfg.
-
#verify_host ⇒ :yes, ...
Verify destination host key.
Methods inherited from Base
Methods inherited from Ansible::Ruby::Models::Base
attr_option, attr_options, attribute, fix_inclusion, #initialize, remove_existing_validations, #to_h, validates
Constructor Details
This class inherits a constructor from Ansible::Ruby::Models::Base
Instance Method Details
#archive ⇒ :yes, ...
Returns Mirrors the rsync archive flag, enables recursive, links, perms, times, owner, group flags and -D.
28 |
# File 'lib/ansible/ruby/modules/generated/files/synchronize.rb', line 28 attribute :archive |
#checksum ⇒ :yes, ...
Returns Skip based on checksum, rather than mod-time & size; Note that that “archive” option is still enabled by default - the “checksum” option will not disable it.
32 |
# File 'lib/ansible/ruby/modules/generated/files/synchronize.rb', line 32 attribute :checksum |
#compress ⇒ :yes, ...
Returns Compress file data during the transfer. In most cases, leave this enabled unless it causes problems.
36 |
# File 'lib/ansible/ruby/modules/generated/files/synchronize.rb', line 36 attribute :compress |
#copy_links ⇒ :yes, ...
Returns Copy symlinks as the item that they point to (the referent) is copied, rather than the symlink.
60 |
# File 'lib/ansible/ruby/modules/generated/files/synchronize.rb', line 60 attribute :copy_links |
#delete ⇒ :yes, ...
Returns Delete files in C(dest) that don’t exist (after transfer, not before) in the C(src) path. This option requires C(recursive=yes).
44 |
# File 'lib/ansible/ruby/modules/generated/files/synchronize.rb', line 44 attribute :delete |
#dest ⇒ String
Returns Path on the destination host that will be synchronized from the source; The path can be absolute or relative.
16 |
# File 'lib/ansible/ruby/modules/generated/files/synchronize.rb', line 16 attribute :dest |
#dest_port ⇒ Array<String>, ...
Returns Port number for ssh on the destination host. Prior to ansible 2.0, the ansible_ssh_port inventory var took precedence over this value.
20 |
# File 'lib/ansible/ruby/modules/generated/files/synchronize.rb', line 20 attribute :dest_port |
#dirs ⇒ :yes, ...
Returns Transfer directories without recursing.
48 |
# File 'lib/ansible/ruby/modules/generated/files/synchronize.rb', line 48 attribute :dirs |
#existing_only ⇒ :yes, ...
Returns Skip creating new files on receiver.
40 |
# File 'lib/ansible/ruby/modules/generated/files/synchronize.rb', line 40 attribute :existing_only |
#group ⇒ Symbol?
Returns Preserve group.
76 |
# File 'lib/ansible/ruby/modules/generated/files/synchronize.rb', line 76 attribute :group |
#link_dest ⇒ String?
Returns add a destination to hard link against during the rsync.
111 |
# File 'lib/ansible/ruby/modules/generated/files/synchronize.rb', line 111 attribute :link_dest |
#links ⇒ Symbol?
Returns Copy symlinks as symlinks.
56 |
# File 'lib/ansible/ruby/modules/generated/files/synchronize.rb', line 56 attribute :links |
#mode ⇒ :pull, ...
Returns Specify the direction of the synchronization. In push mode the localhost or delegate is the source; In pull mode the remote host in context is the source.
24 |
# File 'lib/ansible/ruby/modules/generated/files/synchronize.rb', line 24 attribute :mode |
#owner ⇒ Symbol?
Returns Preserve owner (super user only).
72 |
# File 'lib/ansible/ruby/modules/generated/files/synchronize.rb', line 72 attribute :owner |
#partial ⇒ :yes, ...
Returns Tells rsync to keep the partial file which should make a subsequent transfer of the rest of the file much faster.
100 |
# File 'lib/ansible/ruby/modules/generated/files/synchronize.rb', line 100 attribute :partial |
#perms ⇒ Symbol?
Returns Preserve permissions.
64 |
# File 'lib/ansible/ruby/modules/generated/files/synchronize.rb', line 64 attribute :perms |
#private_key ⇒ Object?
Returns Specify the private key to use for SSH-based rsync connections (e.g. C(~/.ssh/id_rsa)).
108 |
# File 'lib/ansible/ruby/modules/generated/files/synchronize.rb', line 108 attribute :private_key |
#recursive ⇒ Symbol?
Returns Recurse into directories.
52 |
# File 'lib/ansible/ruby/modules/generated/files/synchronize.rb', line 52 attribute :recursive |
#rsync_opts ⇒ Array<String>, ...
Returns Specify additional rsync options by passing in an array.
96 |
# File 'lib/ansible/ruby/modules/generated/files/synchronize.rb', line 96 attribute :rsync_opts |
#rsync_path ⇒ String?
Returns Specify the rsync command to run on the remote host. See C(–rsync-path) on the rsync man page.,To specify the rsync command to run on the local host, you need to set this your task var C(ansible_rsync_path).
80 |
# File 'lib/ansible/ruby/modules/generated/files/synchronize.rb', line 80 attribute :rsync_path |
#rsync_timeout ⇒ Integer?
Returns Specify a C(–timeout) for the rsync command in seconds.
84 |
# File 'lib/ansible/ruby/modules/generated/files/synchronize.rb', line 84 attribute :rsync_timeout |
#set_remote_user ⇒ Boolean?
Returns 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”.
88 |
# File 'lib/ansible/ruby/modules/generated/files/synchronize.rb', line 88 attribute :set_remote_user |
#src ⇒ String
Returns Path on the source host that will be synchronized to the destination; The path can be absolute or relative.
12 |
# File 'lib/ansible/ruby/modules/generated/files/synchronize.rb', line 12 attribute :src |
#times ⇒ Symbol?
Returns Preserve modification times.
68 |
# File 'lib/ansible/ruby/modules/generated/files/synchronize.rb', line 68 attribute :times |
#use_ssh_args ⇒ :yes, ...
Returns Use the ssh_args specified in ansible.cfg.
92 |
# File 'lib/ansible/ruby/modules/generated/files/synchronize.rb', line 92 attribute :use_ssh_args |
#verify_host ⇒ :yes, ...
Returns Verify destination host key.
104 |
# File 'lib/ansible/ruby/modules/generated/files/synchronize.rb', line 104 attribute :verify_host |