Skip to content

Instantly share code, notes, and snippets.

@astorije
Last active October 19, 2018 14:07
Show Gist options
  • Save astorije/70dcb978ab9378a7e953f182538f2805 to your computer and use it in GitHub Desktop.
Save astorije/70dcb978ab9378a7e953f182538f2805 to your computer and use it in GitHub Desktop.

This is a minimal test case for ansible/ansible#47353.

Using the following command:

ANSIBLE_STDOUT_CALLBACK=actionable ansible-playbook -i inventory.cfg playbook.yml

❌ Ansible 2.7.0 incorrectly reports:

PLAY [localhost] ***********************************************************

TASK [Task 3] **************************************************************
changed: [localhost] => {
    "msg": "Task notifying a handler"
}

TASK [Task 3] **************************************************************

TASK [Task 3] **************************************************************
changed: [localhost] => {
    "msg": "This is a handler"
}

PLAY RECAP *****************************************************************
localhost                  : ok=3    changed=2    unreachable=0    failed=0

✅ Ansible 2.6.0 correctly reports:

PLAY [localhost] ***********************************************************

TASK [Task 3] **************************************************************
changed: [localhost] => {
   "msg": "Task notifying a handler"
}

RUNNING HANDLER [Handler 1] ************************************************
changed: [localhost] => {
   "msg": "This is a handler"
}

PLAY RECAP *****************************************************************
localhost                  : ok=3    changed=2    unreachable=0    failed=0
[targets]
localhost ansible_connection=local
- hosts: localhost
gather_facts: no
tasks:
- name: Task 1
debug:
msg: Task hidden by `actionable` because "ok" status
- name: Task 2
debug:
msg: Task hidden by `actionable` because "skipped" status
when: false
- name: Task 3
debug:
msg: Task notifying a handler
changed_when: true
notify: Handler 1
handlers:
- name: Handler 1
debug:
msg: This is a handler
changed_when: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment