On 26.12.2019 16:12, Xinhuan Zheng wrote:
Hello,

I ran my ansible playbook, pb.yml file, with --tags, like following:

ansible-playbook -i "192.168.100.1," pb.yml --tags "networking"

ansible-playbook does NOT collect ansible facts. However, if I run it
without --tages, the ansible facts are collected.

Why is that?

Because you have replaced the tags with the config tag.


Here is my directory layout:

pb.yml
roles/
  networking.yml

Here is the pb.yml:

---

- hosts: all
  gather_facts: yes

  roles:
    - roles: networking
  tags:
    - config

You should read about how tags work in the documentation
https://docs.ansible.com/ansible/latest/user_guide/playbooks_tags.html


--
Kai Stian Olstad

--
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/dd6b50380d78d95fbec57292baae460a%40olstad.com.

Reply via email to