I have Ansible tasks for enabling and disabling Nagios checking for some hosts. They use "delegate_to" the Nagios server. However, I can't use them when the host in question is offline, because Ansible tries to SSH in and marks the task failed when it can't.
Since this task doesn't actually require contacting the host in any way, it seems there should be a way to have Ansible ignore the host and communicate only with the delegate. Is this possible?
ignore_errors: yes
. Alternatively, rework your playbook to talk directly to your Nagios server and use the host in question as a variable.