Skip to content

Commit

Permalink
ci: Use supported ansible-lint action; run ansible-lint against the c…
Browse files Browse the repository at this point in the history
…ollection

Add `---` doc start to .markdownlint.yaml

Fix some other ansible-lint issues in test code

Signed-off-by: Rich Megginson <[email protected]>
  • Loading branch information
richm committed Dec 18, 2023
1 parent cadb9de commit 0c12fb7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
1 change: 1 addition & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# Default state for all rules
default: true

Expand Down
6 changes: 4 additions & 2 deletions tests/roles/caller/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
---
# tasks file for caller

- include_role:
- name: Include role
include_role:
name: "{{ roletoinclude }}"

- assert:
- name: Assert variable not overridden
assert:
that: not __caller_override
11 changes: 10 additions & 1 deletion tests/tests_include_vars_from_parent.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- name: Test role variable override
- name: Test role include variable override
hosts: all
gather_facts: true
tasks:
Expand Down Expand Up @@ -38,9 +38,18 @@
varfiles: "{{ [facts['distribution']] | product(separators) |
map('join') | product(versions) | map('join') | list +
[facts['distribution'], facts['os_family']] }}"
register: __varfiles_created

- name: Import role
import_role:
name: caller
vars:
roletoinclude: linux-system-roles.crypto_policies

- name: Cleanup
file:
path: "{{ item.dest }}"
state: absent
loop: "{{ __varfiles_created.results }}"
delegate_to: localhost
when: inventory_hostname == ansible_play_hosts_all[0]

0 comments on commit 0c12fb7

Please sign in to comment.