i whipped it up from memory, not tested at all, i see you probably need to change the 0 to a 1, but it was meant as a hint not the actual solution.
On Fri, Jan 8, 2016 at 11:33 AM, Arbab Nazar <[email protected]> wrote: > Brain your example change the permission to 0644 to all the files regardless > of extension, can you please help me to modified the provided example. > Thanks > > On Fri, Jan 8, 2016 at 12:19 AM, Brian Coca <[email protected]> wrote: >> >> something like this?: >> >> - find: path=test/ >> register: testfiles >> >> - file: path={{item.path}} mode={{ ((item.path|splitext)[0] in ['sh', >> 'py'])|ternary('0700','0644') }} >> with_items: "{{testfiles.files}}" >> >> On Thu, Jan 7, 2016 at 1:59 PM, Arbab Nazar <[email protected]> wrote: >> > I want to change the permission of the file based on it's extension >> > using >> > ansible, for example I have directory test and within this directory I >> > have >> > a lot of shell script(.sh) and python(.py) files. I want to change the >> > permission of shell script to 0700 and python files to 0644. Can you >> > please >> > help me that how I can achieve this. Thanks >> > >> > -- >> > 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/07141eef-de81-4633-89c3-5579baee927b%40googlegroups.com. >> > For more options, visit https://groups.google.com/d/optout. >> >> >> >> -- >> Brian Coca >> >> -- >> You received this message because you are subscribed to a topic in the >> Google Groups "Ansible Project" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/ansible-project/cM4ls48Mt8Q/unsubscribe. >> To unsubscribe from this group and all its topics, 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/CAJ5XC8%3DXdkWp9PnHdMVv-fRCSLp0Ly-_gc8J-%3DXtab78%3Dvbzfw%40mail.gmail.com. >> 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/CAMfRAgnVmOMz6Yq5vd7_czy%3DQJLspAQVXUML%3DO5Z0J4-TDmJ-w%40mail.gmail.com. > > For more options, visit https://groups.google.com/d/optout. -- Brian Coca -- 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/CAJ5XC8%3DNA8F9QfL6T95Z%3D0RouE7DqTd4R31-dwKSmxpFU6_w7Q%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
