Yes. I have to copy the files to each machine. I will try the "synchronize" method tomorrow. Thanks for the advice.
2014-08-30 3:13 GMT+08:00 Mark McCoy <[email protected]>: > You didn't say that you had hundred of thousands of files, you gave an > example with 7 files. If you have many more than that, perhaps another > method like the "synchronize" module would be better. Also, do you have to > copy the files or can you NFS mount the directory to each machine? > > ---- > Mark McCoy <http://markmccoy.us> > > > > On Fri, Aug 29, 2014 at 1:06 PM, Simon Zhang <[email protected]> wrote: > >> But I just want to specify the same file permissions for the local file >> and remote file. >> >> I have dozens of GB files, hundreds of thousands of files. >> >> >> 2014-08-30 1:31 GMT+08:00 Mark McCoy <[email protected]>: >> >>> If you have specific requirements for each file, why not do this: >>> >>> - copy: src="./test/{{ item.fname }}" dest=/work/test mode={{ >>> item.fmode }} >>> with_items: >>> - { fname: 'aa1.sh', fmode: '0750' } >>> - { fname: 'aa2.txt', fmode: '0644' } >>> >>> >>> >>> >>> ---- >>> Mark McCoy <http://markmccoy.us> >>> >>> >>> >>> On Fri, Aug 29, 2014 at 11:42 AM, Simon Zhang <[email protected]> wrote: >>> >>>> Hi, michael. >>>> >>>> Thank you for your reply. But I still do not understand. >>>> >>>> "The source permissions on the local filesystem are not used." >>>> >>>> When I copy some file on the local filesystem to remote locations, I >>>> may use this method like "copy: src=./test dest=/work/". >>>> >>>> But the problem is that there are many files with different permissions >>>> in a folder "./test", each file separately set mode too much trouble. >>>> >>>> Should we do it like the following example? >>>> >>>> - copy: src=./test/aa1.sh dest=/work/test/ mode=700 >>>> - copy: src=./test/aa2.sh dest=/work/test/ mode=600 >>>> - copy: src=./test/aa3.sh dest=/work/test/ mode=777 >>>> - copy: src=./test/aa4.sh dest=/work/test/ mode=700 >>>> - copy: src=./test/aa5.sh dest=/work/test/ mode=600 >>>> - copy: src=./test/aa6.sh dest=/work/test/ mode=777 >>>> - copy: src=./test/aa7.sh dest=/work/test/ mode=700 >>>> >>>> This should not be reasonable. >>>> >>>> >>>> 2014-08-29 19:59 GMT+08:00 Michael DeHaan <[email protected]>: >>>> >>>>> If you want to control the file permissions when placing a file, also >>>>> be aware you have access to the "mode" parameter. >>>>> >>>>> The source permissions on the local filesystem are not used. >>>>> >>>>> If you are instead saying when replacing the file on the destination >>>>> that the permissions change, let us know. >>>>> >>>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Ansible Project" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to [email protected]. >>>> To post to this group, send email to [email protected]. >>>> To view this discussion on the web visit >>>> https://groups.google.com/d/msgid/ansible-project/CADy8dsAqohe0gEa9p6XVDmHSYtqVwZfC0DwTVv_NSL_RTucmuw%40mail.gmail.com >>>> <https://groups.google.com/d/msgid/ansible-project/CADy8dsAqohe0gEa9p6XVDmHSYtqVwZfC0DwTVv_NSL_RTucmuw%40mail.gmail.com?utm_medium=email&utm_source=footer> >>>> . >>>> >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Ansible Project" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> To post to this group, send email to [email protected]. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/ansible-project/CAP2%3DG9O-SnFm55cbn3ZcJjh2Y22eGUoXC%3Dae8U%2BD0WZ8RX6iEA%40mail.gmail.com >>> <https://groups.google.com/d/msgid/ansible-project/CAP2%3DG9O-SnFm55cbn3ZcJjh2Y22eGUoXC%3Dae8U%2BD0WZ8RX6iEA%40mail.gmail.com?utm_medium=email&utm_source=footer> >>> . >>> >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Ansible Project" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To post to this group, send email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/ansible-project/CADy8dsCGewq0OJZZDKHK9cfRE%3Da2QodVMcD2oDPp02mP5a_R3Q%40mail.gmail.com >> <https://groups.google.com/d/msgid/ansible-project/CADy8dsCGewq0OJZZDKHK9cfRE%3Da2QodVMcD2oDPp02mP5a_R3Q%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> >> For more options, visit https://groups.google.com/d/optout. >> > > -- > You received this message because you are subscribed to the Google Groups > "Ansible Project" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/CAP2%3DG9MByOzZ3r9PqqFL1TSprrbyG%2Bc%2BmJniX%3DgKMgoFt-Y55g%40mail.gmail.com > <https://groups.google.com/d/msgid/ansible-project/CAP2%3DG9MByOzZ3r9PqqFL1TSprrbyG%2Bc%2BmJniX%3DgKMgoFt-Y55g%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CADy8dsDMGpTppi4X9N1bnbETwF4Mc%2BesmfkF8UzdK5dTpBEp2Q%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
