--- - name: Restart mongos listen: Restart mongos service ansible.builtin.service: name: "{{ mongos_service }}" state: restarted when: not skip_restart - name: Wait for port to become active listen: Restart mongos service ansible.builtin.wait_for: host: "{{ bind_ip | split(',') | first }}" port: "{{ mongos_port }}" when: not skip_restart