Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.0R C1: list-tasks does not respect tags #13260

Closed
nikut opened this issue Nov 23, 2015 · 0 comments
Closed

2.0R C1: list-tasks does not respect tags #13260

nikut opened this issue Nov 23, 2015 · 0 comments
Labels
bug This issue/PR relates to a bug.
Milestone

Comments

@nikut
Copy link
Contributor

nikut commented Nov 23, 2015

Issue Type:
  • Bug Report
Ansible Version:

ansible 2.0.0 (detached HEAD f222539) last updated 2015/11/23 17:22:15 (GMT +300)
lib/ansible/modules/core: (detached HEAD 64147ab795) last updated 2015/11/23 17:22:33 (GMT +300)
lib/ansible/modules/extras: (detached HEAD 1a0ff8a8c8) last updated 2015/11/23 17:22:37 (GMT +300)
config file = /etc/ansible/ansible.cfg
configured module search path = Default w/o overrides

Ansible Configuration:

Can be reproduced with default configuration.

Environment:

Can be reproduced on CentOS 5.9 as well as Mac OS X.

Summary:

In Ansible 2.0 RC1 ansible-playbook --tags <sometag> --list-tasks lists all tasks in the playbook even if they would not be run with that tag. It also lists a bunch of "meta" tasks. In 1.9.x this works as expected.

Steps To Reproduce:

Playbook:

- hosts: localhost
  gather_facts: no
  tasks:
    - debug: msg="tag1"
      tags: tag1

    - debug: msg="tag2"
      tags: tag2
Expected Results:

Output from Ansible 1.9.4:

nikut@dhcp98:~/tmp$ ansible-playbook test-tags.yml --tags tag1 --list-tasks

playbook: /tmp/test-tags.yml

  play #1 (localhost):  TAGS: []
    debug msg="tag1"    TAGS: [tag1]
Actual Results:
nikut@dhcp98:~/tmp$ ansible-playbook test-tags.yml --tags tag1 --list-tasks

playbook: test-tags.yml

  PLAY: #1
    tasks:
      TASK: meta 
      TASK: debug msg=tag1
      TASK: debug msg=tag2
      TASK: meta 
      TASK: meta 
@jimi-c jimi-c added this to the v2 milestone Nov 23, 2015
@jimi-c jimi-c removed the P3 label Dec 7, 2015
@jimi-c jimi-c closed this as completed in 5929ffc Dec 17, 2015
jimi-c added a commit that referenced this issue Dec 17, 2015
Also makes the output closer to the appearance of v1

Fixes #13260
@ansibot ansibot added bug This issue/PR relates to a bug. and removed bug_report labels Mar 7, 2018
@ansible ansible locked and limited conversation to collaborators Apr 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue/PR relates to a bug.
Projects
None yet
Development

No branches or pull requests

3 participants