Ansible the copy module batch issued a document

parameter copy module, ansible host group copy -a -m ''
the src: Specifies the source file or directory
dest: target file or directory server
backup: whether to back up
their user copied to the target server, the file or directory: owner
after copied to the target server, belongs to a group of files or directories: group
the MODE: permissions on the file or directory

  1. Issued a document
    ansible all -m copy -a "src=/data/1.txt dest=/data/"
  2. Issued a directory
    ansible all -m copy -a "src=/data/ dest=/usr/local/src/"# directory will not be copied, only issued a directory of all the files in

    ansible all -m copy -a "src=/data dest=/usr/local/src/"all files in the directory and the directory # joint issued
  3. Automatic Backup
    ansible all -m copy -a "src=/data/1.txt dest=/data/ backup=yes"
  4. And assign permissions to control user belongs
    ansible all -m copy -a "src=/data/2.txt dest=/data/ backup=yes owner=nobody group=nobody mode=0600"

Guess you like

Origin www.cnblogs.com/dhzg/p/11408647.html