Created
July 12, 2016 18:41
-
-
Save dekimsey/2cc7844d3994e98bdb8b5410212d268b to your computer and use it in GitHub Desktop.
with_items fails to flag module errors as failures
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: localhost | |
connection: local | |
become: true | |
gather_facts: false | |
tasks: | |
- block: | |
- yum: | |
name: foobar | |
state: installed | |
rescue: | |
- name: Installing missing package dies OK | |
debug: | |
msg: 'The single missing package died correctly, status=failed' | |
- block: | |
- yum: | |
name: "ansible,foobar" | |
rescue: | |
- name: Installing multiple packages (csv) dies OK | |
debug: | |
msg: 'The csv version dies correctly, status=failed' | |
- block: | |
- yum: | |
name: "{{item}}" | |
state: installed | |
with_items: | |
- ansible | |
- foobar | |
rescue: | |
- name: Installing multiple packages (with_items) dies FAILED | |
debug: | |
msg: 'The with_items died and aborts run however status!=failed' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment