15

Googling for Ansible create tar doesn't yield any good results and while there is an unarchive module, there's no archive module.

I'll probably solve it with the command module, but being new in Ansible it makes me think if I'm doing it wrong. I'm pretty sure I'm not the first one in need of taring source code to be uploaded to the production server.

So why is there no archive module and how does the community handle this use case?

duality_
  • 304
  • 2
  • 9
  • 2
    Wouldn't storing your sources in a revision control system such as git/subversion and deploying specific releases make much more sense than deploying tar or zip archives? – HBruijn Sep 04 '15 at 07:36
  • Yes, this is something I plan to improve, though I'm expecting some pushback. That's for another discussion. Right now I have to tar a part of the source locally. Maybe this is the reason, because everybody just checks out the source on production. – duality_ Sep 04 '15 at 07:41
  • _Why?_ Ansible's mailing list is probably a better place to ask. – Mxx Sep 05 '15 at 04:14
  • 1
    Zips aren't used only for RCS. :-) Amazon's Lambda takes code in the form of a zip file. – Scott A Nov 17 '15 at 17:56
  • I've been looking for this for marathon deployments so I can access private docker containers – Peter Klipfel Mar 30 '16 at 17:08

2 Answers2

6

Module has been added in Ansible 2.2 as an extra module, see:

https://docs.ansible.com/ansible/archive_module.html

3

It seems the Ansible folks welcome the idea, but demand has actually not been large enough for someone to step up and create such a module:

ssc
  • 1,159
  • 3
  • 17
  • 30