Skip to content

Commit 773f692

Browse files
committed
ci: support ansible-lint and ansible-test 2.16
Fix yamllint issue with markdownlint config Add cleanup for tests_include_vars_from_parent.yml Signed-off-by: Rich Megginson <[email protected]>
1 parent 43e83f9 commit 773f692

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

.markdownlint.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
# Default state for all rules
23
default: true
34

tests/roles/caller/tasks/main.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
---
22
# tasks file for caller
33

4-
- include_role:
4+
- name: Include role
5+
include_role:
56
name: "{{ roletoinclude }}"
67
public: true
78

8-
- assert:
9+
- name: Test variable override
10+
assert:
911
that: not __caller_override

tests/tests_include_vars_from_parent.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
- name: Test role variable override
2+
- name: Test role include variable override
33
hosts: all
44
gather_facts: true
55
tasks:
@@ -38,13 +38,23 @@
3838
varfiles: "{{ [facts['distribution']] | product(separators) |
3939
map('join') | product(versions) | map('join') | list +
4040
[facts['distribution'], facts['os_family']] }}"
41+
register: __varfiles_created
4142

4243
- name: Import role
4344
import_role:
4445
name: caller
4546
vars:
4647
roletoinclude: linux-system-roles.postgresql
4748

48-
- name: Clean up
49+
- name: Clean up db instance
4950
include_tasks: tasks/clean_instance.yml
5051
tags: tests::cleanup
52+
53+
- name: Cleanup
54+
file:
55+
path: "{{ item.dest }}"
56+
state: absent
57+
loop: "{{ __varfiles_created.results }}"
58+
delegate_to: localhost
59+
when: inventory_hostname == ansible_play_hosts_all[0]
60+
tags: tests::cleanup

0 commit comments

Comments
 (0)