mwjhw216 发表于 2018-7-30 09:32:15

ansible之copy模块

# ansible-doc -s copy  
less 436
  
Copyright (C) 1984-2009 Mark Nudelman
  
less comes with NO WARRANTY, to the extent permitted by law.
  
For information about the terms of redistribution,
  
see the file named README in the less distribution.
  
Homepage: http://www.greenwoodsoftware.com/less
  
- name: Copies files to remote locations.
  
action: copy
  
      backup               # Create a backup file including the timestamp information so you can get the original file back if
  
                               you somehow clobbered it incorrectly.
  
      content                # 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.
  
      dest=                  # Remote absolute path where the file should be copied to. If src is a directory, this must be a
  
                               directory too.
  
      directory_mode         # 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.
  
      follow               # This flag indicates that filesystem links, if they exist, should be followed.
  
      force                  # the default is `yes', which will replace the remote file when contents are different than the
  
                               source. If `no', the file will only be transferred if the
  
                               destination does not exist.
  
      group                  # name of the group that should own the file/directory, as would be fed to `chown'
  
      mode                   # mode the file or directory should be. For those used to `/usr/bin/chmod' remember that modes are
  
                               actually octal numbers (like 0644). Leaving off the leading zero
  
                               will likely have unexpected results. As of version 1.8, the mode
  
                               may be specified as a symbolic mode (for example, `u+rwx' or
  
                               `u=rw,g=r,o=r').
  
      owner                  # name of the user that should own the file/directory, as would be fed to `chown'
  
      remote_src             # 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.
  
      selevel                # level part of the SELinux file context. This is the MLS/MCS attribute, sometimes known as the
  
                               `range'. `_default' feature works as for `seuser'.
  
      serole               # role part of SELinux file context, `_default' feature works as for `seuser'.
  
      setype               # type part of SELinux file context, `_default' feature works as for `seuser'.
  
      seuser               # user part of SELinux file context. Will default to system policy, if applicable. If set to
  
                               `_default', it will use the `user' portion of the policy if
  
                               available
  
      src                  # 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.
  
      validate               # The validation command to run before copying into place. The path to the file to validate is
  
                               passed in via '%s' which must be present as in the example below.
  
                               The command is passed securely so shell features like expansion
  
                               and pipes won't work.
页: [1]
查看完整版本: ansible之copy模块