mirror of https://github.com/ansible/ansible.git
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.
50 lines
926 B
YAML
50 lines
926 B
YAML
4 years ago
|
---
|
||
|
- name: verify ansible_run_tags work as expected
|
||
|
hosts: testhost
|
||
|
gather_facts: False
|
||
|
tasks:
|
||
|
- debug:
|
||
|
var: ansible_run_tags
|
||
|
tags:
|
||
|
- always
|
||
|
|
||
|
- debug:
|
||
|
var: expect
|
||
|
tags:
|
||
|
- always
|
||
|
|
||
|
- assert:
|
||
|
that:
|
||
|
- ansible_run_tags == ['all']
|
||
|
when: expect == 'all'
|
||
|
tags:
|
||
|
- always
|
||
|
|
||
|
- assert:
|
||
|
that:
|
||
|
- ansible_run_tags|sort == ['tag1', 'tag3']
|
||
|
when: expect == 'list'
|
||
|
tags:
|
||
|
- always
|
||
|
|
||
|
- assert:
|
||
|
that:
|
||
|
- ansible_run_tags == ['untagged']
|
||
|
when: expect == 'untagged'
|
||
|
tags:
|
||
|
- always
|
||
|
|
||
|
- assert:
|
||
|
that:
|
||
|
- ansible_run_tags|sort == ['tag3', 'untagged']
|
||
|
when: expect == 'untagged_list'
|
||
|
tags:
|
||
|
- always
|
||
|
|
||
|
- assert:
|
||
|
that:
|
||
|
- ansible_run_tags == ['tagged']
|
||
|
when: expect == 'tagged'
|
||
|
tags:
|
||
|
- always
|