--- - name: Converge hosts: all roles: - ansible-role-icinga2 pre_tasks: - name: update apt cache ansible.builtin.apt: update_cache: true vars: icinga2_ido_host: 127.0.0.1 icinga2_ido_user: icinga icinga2_ido_password: test icinga2_ido_database: icinga icinga2_services: ping: check_command: ping assign: host.address ssh: check_command: ssh assign: (host.address || host.address6) && host.vars.os == "Linux" options: event_command: ping_event icinga2_notification_commands: date: script: test-notification.sh icinga2_scripts: test-notification.sh: | #!/bin/bash date >> /tmp/notification.log icinga2_hosts: localhost: template: generic-host address: 127.0.0.1 vars: os: Linux http_vhosts: http: http_vhosts: "/" icinga: http_vhosts: /icingaweb2 icinga2_check_commands: https: command: '[PluginDir + "/check_http"]' arguments: - name: -H value: $http_vhost$ description: "Host name argument for servers using host headers (virtual host)" required: true icinga2_event_commands: ping_event: command: '"/usr/bin/ping -c 1 -t 1 127.0.0.1"' icinga2_dependencies: test: parent_host_name: host.name disable_notifications: false assign: "true"