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/roles/end_role.yml

36 lines
864 B
YAML

- hosts: localhost
gather_facts: false
pre_tasks:
- set_fact:
play_checkpoint: 1
roles:
- end_role_inside
tasks:
- set_fact:
play_checkpoint: "{{ play_checkpoint|int + 1 }}"
- import_role:
name: end_role_inside
allow_duplicates: true
- set_fact:
play_checkpoint: "{{ play_checkpoint|int + 1 }}"
- include_role:
name: end_role_inside
allow_duplicates: false
- set_fact:
play_checkpoint: "{{ play_checkpoint|int + 1 }}"
post_tasks:
- assert:
that:
- role_executed|int == 2
- after_end_role is undefined
- play_checkpoint|int == 4
- role_handler_ran is defined
- name: when running this playbook check this appears on stdout to ensure the above assert wasn't skipped
debug:
msg: CHECKPOINT