---

- name: "Restart Nagios container"
  block:
    - name: "Remove Nagios container"
      community.docker.docker_compose_v2:
        project_src: "/home/docker/nagios/"
        remove_orphans: true
        state: absent
      listen: "restart nagios container"

    - name: "Start Nagios container"
      community.docker.docker_compose_v2:
        project_src: "/home/docker/nagios/"
        recreate: always
        remove_orphans: true
        state: present
      listen: "restart nagios container"
