---
- hosts: all
gather_facts: true
# sudo: yes
tasks:
- nagios: action=downtime minutes=5 author="Dimitri Yioulos" service=host host={{item}}
with_items: "{{ groups['test'] }}"
delegate_to: admin2
tags:
- nagios_downtime
- nagios: action=downtime minutes=5 author="Dimitri Yioulos" service=all host={{item}}
with_items: "{{ groups['test'] }}"
delegate_to: admin2
tags:
- nagios_downtime
These tasks put all of the hosts in the 'test' group, and their services, in Downtime for five minutes. The Nagios server is admin2. With hosts and their services in Downtime I can, of course, reboot the hosts without setting off alerts.
HTH.