mirror of https://github.com/ansible/ansible.git
Update docs for --tags default, and add some tests (#70939)
Change: - Clarify that not passing `--tags` will cause `ansible_run_tags` to default to `["all"]`. - Add some extra coverage around `ansible_run_tags` Test Plan: - New integration and unit tests Tickets: - Fixes #69619 Signed-off-by: Rick Elrod <rick@elrod.me>pull/70990/head
parent
b1cb2553af
commit
14dc4de424
@ -0,0 +1,49 @@
|
||||
---
|
||||
- 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
|
Loading…
Reference in New Issue