Dumb n00b question. I am trying to run several play books against one system. If any one of the play books fails, Ansible exits with an RC = 1. I think I have it distilled this down to the below code:
[root@pdxvnxutil ansible]# ansible-playbook -l farmer playbooks/test.yml
SSH password:
PLAY: ***************************************************************************
TASK [setup] ********************************************************************
ok: [farmer]
PLAY RECAP **********************************************************************
farmer : ok=1 changed=0 unreachable=0 failed=0
[root@pdxvnxutil ansible]# echo $?
0
[root@pdxvnxutil ansible]# cat playbooks/test.yml
- hosts: farmer
[root@pdxvnxutil ansible]#
As farmer does not match fuzzy_not_farmer, I would expect the below to fail the first hosts test, but not fail totally out! The play book exits and never gets to the rest of the play book?
[root@pdxvnxutil ansible]# ansible-playbook -l farmer playbooks/test.yml
SSH password:
PLAY: ***************************************************************************
skipping: no hosts matched
PLAY RECAP **********************************************************************
[root@pdxvnxutil ansible]# echo $?
1
[root@pdxvnxutil ansible]# cat playbooks/test.yml
-
hosts: fuzzy_not_farmer (Exits with 1, and never gets to the next host)
-
hosts: farmer
[root@pdxvnxutil ansible]#
Any ideas?