- debug:
    msg: Installing Nagios configuration for host {{ item.host_name }}

- name: Copy nagios server file
  template:
    src: ../templates/monitoring/nagios_server.j2
    dest: /etc/nagios/servers/{{ item.host_name }}.cfg
    owner: root
    group: nagios
    mode: 0640
  notify:
  - reload nagios