You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/test/integration/targets/includes/include_role_missing.yml

25 lines
502 B
YAML

- hosts: localhost
gather_facts: no
tasks:
- file:
path: roles/rolename
state: "{{ item }}"
loop:
- absent
- directory
- name: ensure we fail when missing both file and tasks/ subdir
block:
- include_role:
name: rolename
tasks_from: missing.yml
rescue:
- set_fact:
wefailed: True
always:
- name: check we actually failed
assert:
that:
- wefailed is defined
- wefailed