On 12.12.2016 20:50, John Oliver wrote:
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?

When the a task fails for a host, Ansible will stop the play for that host and no subsequent task will be executed if ignore_errors is not set to true.

--
Kai Stian Olstad

--
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/3ad0c5711263b0f1383bf9a672d20bdf%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to