alternatives: test that path parameter is checked

Relates: #24800
This commit is contained in:
Pierre-Louis Bonicoli 2017-08-29 17:15:04 +02:00 committed by Matt Clay
parent e9d202f944
commit 5c029abac1
2 changed files with 16 additions and 0 deletions

View file

@ -40,6 +40,10 @@
vars:
with_alternatives: False
mode: auto
# Test that path is checked: alternatives must fail when path is nonexistent
- import_tasks: path_is_checked.yml
always:
- include_tasks: remove_links.yml

View file

@ -0,0 +1,12 @@
- name: Try with nonexistent path
alternatives:
name: dummy
path: '/non/existent/path/there'
link: '/usr/bin/dummy'
ignore_errors: True
register: alternative
- name: Check previous task failed
assert:
that:
- 'alternative|failed'