My little playbook:
- hosts: all
become: true
become_user: root
become_method: sudo
tasks:
-
name: Update McAfee virus definitions
shell: /opt/McAfee/LinuxShield/bin/nails task --run 1
register: result -
name: Update McAfee virus definitions 2
shell: /opt/NAI/LinuxShield/bin/nails task --run 1
when: result|failed
I did this because one of my hosts doesn’t have nails installed where the rest do. Why? Dunno. But when I run this, all of the hosts that have the first command run successfully are skipped, as I expected, but the one isn’t mentioned at all, other than the failure in the first case. That one host was completely skipped for the second command. Any ideas why?