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.

Reply via email to