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

meta: flush_handlers does not work in roles if --tags is used #10758

Closed
resmo opened this issue Apr 17, 2015 · 1 comment
Closed

meta: flush_handlers does not work in roles if --tags is used #10758

resmo opened this issue Apr 17, 2015 · 1 comment
Labels
bug This issue/PR relates to a bug. P2 Priority 2 - Issue Blocks Release

Comments

@resmo
Copy link
Contributor

resmo commented Apr 17, 2015

Issue Type:

Bug Report

Ansible Version:
  • devel
  • 1.9.0.1
  • 1.9.1-rc2
Environment:

Tested on ArchOS, Ubuntu 14.04 LTS

Summary:

- meta: flush_handlers does not work in roles if role has a tag and --tags is used. with that role tag.

Steps To Reproduce:
# playbook test.yml 

---
- hosts: localhost
  gather_facts: no
  roles:
  - { role: test_role, tags: ['test_role'] }
# role tasks: test_role/tasks/main.yml 

---
- shell: echo test flush handlers start
  notify: test flush_handlers

- meta: flush_handlers

- shell: echo test flush handlers end
# role handler: test_role/handlers/main.yml 

---
- name: test flush_handlers
  debug: msg="should not run at the end"
ansible-playbook test.yml --tags test_role
Expected Results:
PLAY [localhost] ************************************************************** 

TASK: [test_role | shell echo test flush handlers start] ********************** 
changed: [localhost]

NOTIFIED: [test_role | test flush_handlers] *********************************** 
ok: [localhost] => {
    "msg": "should not run at the end"
}

TASK: [test_role | shell echo test flush handlers end] ************************ 
changed: [localhost]

PLAY RECAP ******************************************************************** 
localhost                  : ok=3    changed=2    unreachable=0    failed=0  
Actual Results:
PLAY [localhost] ************************************************************** 

TASK: [test_role | shell echo test flush handlers start] ********************** 
changed: [localhost]

TASK: [test_role | shell echo test flush handlers end] ************************ 
changed: [localhost]

NOTIFIED: [test_role | test flush_handlers] *********************************** 
ok: [localhost] => {
    "msg": "should not run at the end"
}

PLAY RECAP ******************************************************************** 
localhost                  : ok=3    changed=2    unreachable=0    failed=0 
@bcoca bcoca added bug_report P2 Priority 2 - Issue Blocks Release labels Apr 17, 2015
jimi-c added a commit that referenced this issue Apr 17, 2015
@jimi-c jimi-c closed this as completed in f4172fb Apr 17, 2015
@jimi-c
Copy link
Member

jimi-c commented Apr 17, 2015

Closing This Ticket

Hi!

We believe the above commit should resolve this problem for you. This will also be included in the next release.

If you continue seeing any problems related to this issue, or if you have any further questions, please let us know by stopping by one of the two mailing lists, as appropriate:

Because this project is very active, we're unlikely to see comments made on closed tickets, but the mailing list is a great way to ask questions, or post if you don't think this particular issue is resolved.

Thank you!

@ansibot ansibot added bug This issue/PR relates to a bug. and removed bug_report labels Mar 6, 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. P2 Priority 2 - Issue Blocks Release
Projects
None yet
Development

No branches or pull requests

4 participants