---
- name: Configure hosts & deploy application
  hosts: all
  vars:
    mongo_bind_ip: 0.0.0.0
  tasks:
     - name: Change mongo config file
       become: true
       template:
          src: templates/mongod.conf.j2
          dest: /etc/mongod.conf
          mode: 0644
       tags: db-tagg 


---
- name: Configure hosts & deploy application
  hosts: all
  vars:
    mongo_bind_ip: 0.0.0.0
  tasks:
     - name: Change mongo config file
       become: true
       template:
          src: templates/mongod.conf.j2
          dest: /etc/mongod.conf
          mode: 0644
       tags: db-tagg 
       notify: restart mongod


  handlers:
     - name: restart mongod
       become: true
       service: name=mongod state=restarted


Add handler for restart mongod
Add handler for restart mongod
