Multiple Tasks Calling a Handler in a Play

Ansible Terminal
  tasks:

  - name: Ensure httpd package is present
    yum:
      name: httpd
      state: latest
    notify: httpd_running

  - name: Verify correct config file is present
    template:
      src: files/httpd.conf.j2
      dest: /etc/httpd/conf/httpd.conf
    notify: httpd_running

  handlers:

  - name: httpd_running
    service:
      name: httpd
      state: restarted
			

Multiple Tasks Calling a Handler in a Play

Ansible Terminal
  tasks:

  - name: Ensure httpd package is present
    yum:
      name: httpd
      state: latest
    notify: httpd_running                                    

  - name: Verify correct config file is present
    template:
      src: files/httpd.conf.j2
      dest: /etc/httpd/conf/httpd.conf
    notify: httpd_running                                    

  handlers:

  - name: httpd_running
    service:
      name: httpd
      state: restarted
			

Multiple Tasks Calling a Handler in a Play

Ansible Terminal
  tasks:

  - name: Ensure httpd package is present
    yum:
      name: httpd
      state: latest
    notify: httpd_running

  - name: Verify correct config file is present
    template:
      src: files/httpd.conf.j2
      dest: /etc/httpd/conf/httpd.conf
    notify: httpd_running

  handlers:                                                  
                                                             
  - name: httpd_running                                      
    service:
      name: httpd
      state: restarted
			

Multiple Tasks Calling a Handler in a Play

Ansible Terminal
  tasks:
  
  - name: Ensure httpd package is present
    yum:
      name: httpd
      state: latest
    notify: httpd_running                                    

  - name: Verify correct config file is present
    template:
      src: files/httpd.conf.j2
      dest: /etc/httpd/conf/httpd.conf
    notify: httpd_running                                    

  handlers:                                                  
                                                             
  - name: httpd_running                                      
    service:
      name: httpd
      state: restarted