# I am new to ansible modules / playbooks and I simply can not get the archive module to work

**URL:** <https://forum.ansible.com/t/i-am-new-to-ansible-modules-playbooks-and-i-simply-can-not-get-the-archive-module-to-work/23884>\
**Category:** Ansible Project\
**Created:** [March 4, 2017, 3:10am UTC](https://forum.ansible.com/t/i-am-new-to-ansible-modules-playbooks-and-i-simply-can-not-get-the-archive-module-to-work/23884 "2017-03-04T03:10:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Brendlinger](https://avatars.discourse-cdn.com/v4/letter/d/ccd318/32.png) [@David\_Brendlinger](https://forum.ansible.com/u/David_Brendlinger)\
**Post date:** [March 4, 2017, 3:10am UTC](https://forum.ansible.com/t/i-am-new-to-ansible-modules-playbooks-and-i-simply-can-not-get-the-archive-module-to-work/23884/1 "2017-03-04T03:10:49Z")

</div>

I just want to make a very simple playbook using the archive module:

[http://docs.ansible.com/ansible/archive\_module.html](http://docs.ansible.com/ansible/archive_module.html)

I tried many things including:

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [March 4, 2017, 9:18am UTC](https://forum.ansible.com/t/i-am-new-to-ansible-modules-playbooks-and-i-simply-can-not-get-the-archive-module-to-work/23884/2 "2017-03-04T09:18:36Z")

</div>

> I just want to make a very simple playbook using the archive module:
> 
> [http://docs.ansible.com/ansible/archive\_module.html](http://docs.ansible.com/ansible/archive_module.html)

If you look at the top of this site you will see it says  
"New in version 2.3.", Ansible 2.3 is not released yet.

> I tried many things including:  
> ---  
> &nbsp;&nbsp;- hosts: all  
> &nbsp;&nbsp;&nbsp;&nbsp;tasks:  
> &nbsp;&nbsp;&nbsp;&nbsp;- name: Archive
> 
> - archive:  
> &nbsp;&nbsp;&nbsp;&nbsp;path: /path/to/foo  
> &nbsp;&nbsp;&nbsp;&nbsp;dest: /path/to/foo.tgz
> 
> Can someone show me how to archive a file in a playbook ?

When posting problems we appreciate the error messages as well, this makes it much easier to help.  
I'm guessing you are using Ansible 2.2 that do not include this module.

You YAML syntax is also wrong, in YAML indentation(spaces) is very important and need to be consistent.  
Take a look at this page and you will see how playbook is written  
[https://docs.ansible.com/ansible/playbooks\_intro.html](https://docs.ansible.com/ansible/playbooks_intro.html)

If you have 2.3 the correct playbook should look like this (indentation 2 spaces)
