Per the documentation: "recursively set the specified file attributes (applies only to state=directory) (added in Ansible 1.1)"
So the mode specified when using recurse=yes should be the mode you want applied to the directories. If you want more complex permission setups for large directories of files, I would recommend looking at the synchronize module. On Thu, Jun 5, 2014 at 10:35 AM, Paul Sokolovsky <[email protected]> wrote: > Hello, > > I just found out that "file" module's "mode" param accepts only octal > value. That comes as a little surprise, as > http://docs.ansible.com/file_module.html described "mode" as "mode the > file or directory should be, such as 0644 as would be fed to chmod". I > can feed "g+w" to chmod, so I kinda expected being able to use it with > Ansible either. > > Anyway, how can I set just some, not all, permission bits of a > recursive directory hierarchy? The culprit is "x" permission, which > means completely different things for file vs dir. So, if I use 0775, > all files will become executable. And if I use 0664, all directories > would become non-searchable. > > To remind, chmod, besides constructs like "g+w" to set just "w" bit for > groups, has another device to deal with the issue above - > "X" (capital), which will set "x" bit only for dirs. > > > Thanks, > Paul mailto:[email protected] > > -- > 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/20140605183541.1db3966c%40x34f > . > 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/CAMFyvFhtgK7mzzyevAux9SmExXYeWkwUsj5b6i6nU2QBpKftpw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
