Why are task notifications not available?

The problem I encountered is quite common, but other solutions did not help me. As follows from this question, when I start my play, only the first notification handler is executed. that is, only firewalld is restarted, but the updated bash profile is not used.

Some people suggested notifying the chain, but I would not want to combine the two tasks with completely different goals. For example, one task might be to add ports to firewalld and then restart; another can update my bash profile to display the date with the output of the command history.

NB the above snippet is not my full .yml, only part of it, so this may or may not work. But the source file works.

---
  tasks  
   - name: add port-80 to firewalld
     firewalld: zone=drop port=80/tcp permanent=true state=enabled

   - name: add port-443 to firewalld
     firewalld: zone=drop port=443/tcp permanent=true state=enabled

   - shell: firewall-cmd --reload
     notify:
      - Restart firewalld

   - name: Enabling time display in history
     blockinfile:
     dest: ~/.bash_profile
     block: |
         export HISTTIMEFORMAT="%d/%m/%y %T "
     notify:
      - Source the updated Bash profile


  handlers:
   - name: Restart firewalld
     service: name=firewalld state=restarted

   - name: Source the updated Bash profile
     shell: source ~/.bash_profile

...
+4
1

, .

, changed .

, , - , . , .

,

---
- hosts: varnish
  remote_user: root

  tasks:    
   - name: Install tree
     yum: name=tree state=absent
     notify:
      - Do an echo

  handlers:
   - name: Do an echo
     debug: msg="This will be printed"    
...

.

:

TASK [Install tree] ************************************************************
changed: [192.***.***.**]

RUNNING HANDLER [Do an echo] ***************************************************
ok: [192.***.***.**] => {
    "msg": "This will be printed"
}

PLAY RECAP *********************************************************************
192.***.***.**             : ok=1    changed=1    unreachable=0    failed=0   

( changed=1) .

:

TASK [Install tree] ************************************************************
ok: [192.***.***.**]

PLAY RECAP *********************************************************************
192.***.***.**             : ok=0    changed=0    unreachable=0    failed=0   

, , - , , ( ).

, .

+5

All Articles