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?

  • 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 4, 2015 at 7: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 4, 2015 at 7:41
  • Why? Ansible's mailing list is probably a better place to ask.
    – Mxx
    Sep 5, 2015 at 4: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, 2015 at 17:56
  • I've been looking for this for marathon deployments so I can access private docker containers Mar 30, 2016 at 17:08

2 Answers 2


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



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:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.