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:
> ---
> - hosts: all
> tasks:
> - name: Archive
>
> - archive:
> path: /path/to/foo
> 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
If you have 2.3 the correct playbook should look like this (indentation
2 spaces)
---
- hosts: all
tasks:
- name: Archive
archive:
path: /path/to/foo
dest: /path/to/foo.tgz
>
> Is there a better place for newbies to post this level of question?
No, this is the correct place. Welcome to the community.
--
Kai Stian Olstad