I'm trying to quiet Nagios alerts after a Windows update, but before 
reboot.  I call the playbook like this:

ansible-playbook -l ws0 win_updatelyrisserversB.yml (with or without -u)

Here are the relevant parts of my playbook:

- hosts: all
  gather_facts: false

  tasks:
    - name: win update
      win_updates:
        category: 
['SecurityUpdates','CriticalUpdates','Updates','Tools','DefinitionUpdates','UpdateRollups']
      register: reboot_hint
      tags:
         - update

- hosts: all
  gather_facts: false
  sudo: yes

  tasks:
    - nagios: action=downtime minutes=5 author="Dimitri Yioulos" 
service=host host={{item}}
#      with_items: "{{ play_hosts }}"
#      with_items: "{{ groups['lyris'] }}"
      with_items:
         - ws0
      delegate_to: admin2
#      when: hostvars[item]['reboot_hint']['reboot_required']
#      when: ['reboot_hint.reboot_required']
      tags:
         - nagios_downtime
    - nagios: action=downtime minutes=5 author="Dimitri Yioulos" 
service=all host={{item}}
#      with_items: "{{ play_hosts }}"
#      with_items: "{{ groups['lyris'] }}"
      with_items:
         - ws0
      delegate_to: admin2
#      when: hostvars[item]['reboot_hint']['reboot_required']
#      when: ['reboot_hint.reboot_required']
      tags:
         - nagios_downtime

- hosts: all
  gather_facts: false

  tasks:
    - name: reboot server
      raw: 'cmd /c shutdown /r /t 0'
      when: reboot_hint.reboot_required == true
      tags:
         - reboot

The Nagios play fails like this:

TASK: [nagios action=downtime minutes=5 author="Dimitri Yioulos" 
service=host host={{item}}] *** 
fatal: [ws0 -> admin2] => Authentication failure.

FATAL: all hosts have already failed -- aborting

As you can see from the commented out parts of the Nagios play, I've tried 
several things (many not shown) to try and make this work, if even 
possible.  Can anyone help?

Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/ab113c95-095a-4f20-aa6e-23f27dbc4ecb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to