---
- name: Setup Nagios server files
  hosts: localhost


  tasks:

  - name: Update Nagios server configuration files
    include_tasks: monitoring_server_files.yaml
    loop:
      - {host_name: aegis.ping.local, host_ip: 192.168.111.21}
      - {host_name: centos8test.ping.local , host_ip: 192.168.111.41}
      - {host_name: dropshuttle.ping.local, host_ip: 192.168.111.113}
      - {host_name: fedora33test.ping.local, host_ip: 192.168.111.42}
      - {host_name: jezynka.ping.local, host_ip: 192.168.111.110}
      - {host_name: malinka.ping.local, host_ip: 192.168.111.106}
      - {host_name: leap15test.ping.local, host_ip: 192.168.111.43}
      - {host_name: outpost.ping.local, host_ip: 192.168.111.95}
      - {host_name: potemkin.ping.local, host_ip: 192.168.111.19}
      - {host_name: python-cave.ping.local, host_ip: 192.168.111.50}
      - {host_name: rawhide.ping.local, host_ip: 192.168.111.81}
      - {host_name: rhel8.ping.local, host_ip: 192.168.111.83}
      - {host_name: strategie.ping.local, host_ip: 192.168.111.60}
      - {host_name: stream.ping.local, host_ip: 192.168.111.82}
      - {host_name: ubuntu2004test.ping.local, host_ip: 192.168.111.40}
      - {host_name: union.ping.local, host_ip: 192.168.111.96}
  

  handlers:

  - name: reload nagios
    systemd:
      name: nagios
      state: reloaded