Class: Ansible::Ruby::Modules::Copy

Inherits:
Base show all
Includes:
MissingFileStuff
Defined in:
lib/ansible/ruby/modules/generated/core/files/copy.rb,
lib/ansible/ruby/modules/custom/files/copy.rb

Overview

The M(copy) module copies a file on the local box to remote locations. Use the M(fetch) module to copy files from remote locations to the local box. If you need variable interpolation in copied files, use the M(template) module.

Instance Method Summary collapse

Methods included from MissingFileStuff

included

Methods inherited from Base

#ansible_name, #to_h

Methods inherited from Ansible::Ruby::Models::Base

attr_option, attr_options, attribute, #initialize, remove_existing_validations, #to_h, validates

Constructor Details

This class inherits a constructor from Ansible::Ruby::Models::Base

Instance Method Details

#backup:yes, ...

Returns Create a backup file including the timestamp information so you can get the original file back if you somehow clobbered it incorrectly.

Returns:

  • (:yes, :no, nil)

    Create a backup file including the timestamp information so you can get the original file back if you somehow clobbered it incorrectly.



22
# File 'lib/ansible/ruby/modules/generated/core/files/copy.rb', line 22

attribute :backup

#contentObject?

Returns When used instead of ‘src’, sets the contents of a file directly to the specified value. This is for simple values, for anything complex or with formatting please switch to the template module.

Returns:

  • (Object, nil)

    When used instead of ‘src’, sets the contents of a file directly to the specified value. This is for simple values, for anything complex or with formatting please switch to the template module.



15
# File 'lib/ansible/ruby/modules/generated/core/files/copy.rb', line 15

attribute :content

#destString

Returns Remote absolute path where the file should be copied to. If src is a directory, this must be a directory too.

Returns:

  • (String)

    Remote absolute path where the file should be copied to. If src is a directory, this must be a directory too.



18
# File 'lib/ansible/ruby/modules/generated/core/files/copy.rb', line 18

attribute :dest

#directory_modeObject?

Returns When doing a recursive copy set the mode for the directories. If this is not set we will use the system defaults. The mode is only set on directories which are newly created, and will not affect those that already existed.

Returns:

  • (Object, nil)

    When doing a recursive copy set the mode for the directories. If this is not set we will use the system defaults. The mode is only set on directories which are newly created, and will not affect those that already existed.



30
# File 'lib/ansible/ruby/modules/generated/core/files/copy.rb', line 30

attribute :directory_mode

#follow:yes, ...

Returns This flag indicates that filesystem links, if they exist, should be followed.

Returns:

  • (:yes, :no, nil)

    This flag indicates that filesystem links, if they exist, should be followed.



37
# File 'lib/ansible/ruby/modules/generated/core/files/copy.rb', line 37

attribute :follow

#force:yes, ...

Returns the default is C(yes), which will replace the remote file when contents are different than the source. If C(no), the file will only be transferred if the destination does not exist.

Returns:

  • (:yes, :no, nil)

    the default is C(yes), which will replace the remote file when contents are different than the source. If C(no), the file will only be transferred if the destination does not exist.



26
# File 'lib/ansible/ruby/modules/generated/core/files/copy.rb', line 26

attribute :force

#remote_src:True, ...

Returns If False, it will search for src at originating/master machine, if True it will go to the remote/target machine for the src. Default is False.,Currently remote_src does not support recursive copying.

Returns:

  • (:True, :False, nil)

    If False, it will search for src at originating/master machine, if True it will go to the remote/target machine for the src. Default is False.,Currently remote_src does not support recursive copying.



33
# File 'lib/ansible/ruby/modules/generated/core/files/copy.rb', line 33

attribute :remote_src

#srcString?

Returns Local path to a file to copy to the remote server; can be absolute or relative. If path is a directory, it is copied recursively. In this case, if path ends with “/”, only inside contents of that directory are copied to destination. Otherwise, if it does not end with “/”, the directory itself with all contents is copied. This behavior is similar to Rsync.

Returns:

  • (String, nil)

    Local path to a file to copy to the remote server; can be absolute or relative. If path is a directory, it is copied recursively. In this case, if path ends with “/”, only inside contents of that directory are copied to destination. Otherwise, if it does not end with “/”, the directory itself with all contents is copied. This behavior is similar to Rsync.



11
# File 'lib/ansible/ruby/modules/generated/core/files/copy.rb', line 11

attribute :src