rsync file permissions

30 views
Skip to first unread message

niko.sto...@wearefriday.com

unread,
Mar 23, 2015, 1:17:37 PM3/23/15
to ansible...@googlegroups.com
I'm trying to copy over files with rsync. file creates main directory and any additional as catalogs. Owner and permission are set correctly. For now I only have a file in the catalogs directory. When synchronize kicks in it copies over the file, but changes the ownership of the directory and file to 1343414997:1778475765.
 
    - name: create directory
      file: path=/var/www/html/munki_repo state=directory owner=munki group=munki

    - name: additional directories
      file: path=/var/www/html/munki_repo/catalogs state=directory owner=munki group=munki

    - name: additional directories
      file: path=/var/www/html/munki_repo/icons state=directory owner=munki group=munki


    - name: rsync
      synchronize: src=/Users/niko.stojanovski/vagrant/vagrant-centos-6.5/munki_repo dest=/var/www/html/munki_repo recursive=yes rsync_path="sudo rsync"


 

 

Dan Vaida

unread,
Mar 28, 2015, 1:26:49 PM3/28/15
to ansible...@googlegroups.com
try to set owner=no group=no in the synchronize task.

The uid & gid from your host are not reflected on your target system.
Also, you could condense like:

file: path=/var/www/html/munki_repo/{{ item }} state=directory owner=munki group=munki recurse=yes
with_items:
  - catalogs
  - icons
Reply all
Reply to author
Forward
0 new messages