Missing functionality?

44 views
Skip to first unread message

John Oliver

unread,
Oct 1, 2014, 6:51:44 PM10/1/14
to ansible...@googlegroups.com
The 'file' module could use the "directory_mode" directive.

And 'unarchive' could use "owner", "group", "mode", "serole", "setype", etc.  As well as "directory_mode"

Unless I'm completely missing something, but it seems I should be able to unzip a local archive to the target, set ownership and permissions, etc. in one task instead of two or three.

James Cammarata

unread,
Oct 1, 2014, 8:26:03 PM10/1/14
to ansible...@googlegroups.com
Hi John, 

Those options should be available to both of those modules - I believe it is a mistake in the documentation that they are missing. If you have any trouble specifying those options with either module please let us know, and I will get the documentation updated in the mean time.

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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/19b117a4-f280-4fc5-8175-f8d5add7fa06%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

James Cammarata

unread,
Oct 1, 2014, 8:33:41 PM10/1/14
to ansible...@googlegroups.com
Also, as far as the directory_mode option goes, the copy module is the only one that uses that, so it is not available in the other modules.

John Oliver

unread,
Oct 2, 2014, 10:22:36 AM10/2/14
to ansible...@googlegroups.com
Why is that?  I can think of a huge array of use cases where I'd want to set different permissions on files vs. directories that already exist or are being created from an 'unarchive' action.

James Cammarata

unread,
Oct 2, 2014, 1:20:03 PM10/2/14
to ansible...@googlegroups.com
That option was a recent addition to copy, but was not written into use for any of the other modules, mainly because copy is the only one of the files which does a recursive copy. Synchronize does, but it's using rsync under the hood, which manages the permissions via flags (and synchronize does not use the general file parameters like file/copy/template/etc. do). 

Unarchive works similarly, since tar and other archive formats can preserve the user/group/permissions as well. Those modules could be extended to make that parameter override whatever's in the file, but that feature has, until now, not been proposed. You're more than welcome to open a GitHub feature request issue for that functionality.


--
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages