Hi
It seems that https://github.com/ansible/ansible/issues/13602 is back in 
Ansible 2.1.1 and devel. Running ansible-playbook with -t will collect 
facts even if no task/role in the play is selected. This also happens with 
smart gathering, if the fact cache is expired. Example:

test.yml:
---
- name: No tagged task here
  hosts: localhost
  tasks:
    - debug: msg="I won't run"

- name: Tagged task here
  hosts: localhost
  tasks:
    - debug: msg="tagged task"
      tags: runme

And this is the output after clearing the fact cache:

$ ansible-playbook test.yml -t runme
 [WARNING]: Host file not found: /etc/ansible/hosts

 [WARNING]: provided hosts list is empty, only localhost is available


PLAY [No tagged task here] 
*****************************************************

TASK [setup] 
*******************************************************************
ok: [localhost]

PLAY [Tagged task here] 
********************************************************

TASK [debug] 
*******************************************************************
ok: [localhost] => {
    "msg": "tagged task"
}

The setup task is run on the untagged play, like reported in #13602


-- 
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/0e8439f1-ee1d-426f-bfdb-1ce93b81011c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to