diff --git a/.markdownlint.yaml b/.markdownlint.yaml index 4f8a979..6bf4ccd 100644 --- a/.markdownlint.yaml +++ b/.markdownlint.yaml @@ -1,3 +1,4 @@ +--- # Default state for all rules default: true diff --git a/.sanity-ansible-ignore-2.11.txt b/.sanity-ansible-ignore-2.11.txt index e8e8838..617632f 100644 --- a/.sanity-ansible-ignore-2.11.txt +++ b/.sanity-ansible-ignore-2.11.txt @@ -1,3 +1 @@ plugins/modules/nbde_client_clevis.py validate-modules:missing-gplv3-license -plugins/modules/nbde_client_clevis.py validate-modules:module-invalid-version-added -plugins/modules/nbde_client_clevis.py validate-modules:parameter-list-no-elements diff --git a/.sanity-ansible-ignore-2.12.txt b/.sanity-ansible-ignore-2.12.txt index e8e8838..617632f 100644 --- a/.sanity-ansible-ignore-2.12.txt +++ b/.sanity-ansible-ignore-2.12.txt @@ -1,3 +1 @@ plugins/modules/nbde_client_clevis.py validate-modules:missing-gplv3-license -plugins/modules/nbde_client_clevis.py validate-modules:module-invalid-version-added -plugins/modules/nbde_client_clevis.py validate-modules:parameter-list-no-elements diff --git a/.sanity-ansible-ignore-2.13.txt b/.sanity-ansible-ignore-2.13.txt index 997574c..617632f 100644 --- a/.sanity-ansible-ignore-2.13.txt +++ b/.sanity-ansible-ignore-2.13.txt @@ -1,2 +1 @@ plugins/modules/nbde_client_clevis.py validate-modules:missing-gplv3-license -plugins/modules/nbde_client_clevis.py validate-modules:parameter-list-no-elements diff --git a/.sanity-ansible-ignore-2.14.txt b/.sanity-ansible-ignore-2.14.txt index 997574c..617632f 100644 --- a/.sanity-ansible-ignore-2.14.txt +++ b/.sanity-ansible-ignore-2.14.txt @@ -1,2 +1 @@ plugins/modules/nbde_client_clevis.py validate-modules:missing-gplv3-license -plugins/modules/nbde_client_clevis.py validate-modules:parameter-list-no-elements diff --git a/.sanity-ansible-ignore-2.15.txt b/.sanity-ansible-ignore-2.15.txt index 997574c..617632f 100644 --- a/.sanity-ansible-ignore-2.15.txt +++ b/.sanity-ansible-ignore-2.15.txt @@ -1,2 +1 @@ plugins/modules/nbde_client_clevis.py validate-modules:missing-gplv3-license -plugins/modules/nbde_client_clevis.py validate-modules:parameter-list-no-elements diff --git a/.sanity-ansible-ignore-2.16.txt b/.sanity-ansible-ignore-2.16.txt new file mode 100644 index 0000000..617632f --- /dev/null +++ b/.sanity-ansible-ignore-2.16.txt @@ -0,0 +1 @@ +plugins/modules/nbde_client_clevis.py validate-modules:missing-gplv3-license diff --git a/library/nbde_client_clevis.py b/library/nbde_client_clevis.py index abc6922..b65de04 100644 --- a/library/nbde_client_clevis.py +++ b/library/nbde_client_clevis.py @@ -14,7 +14,6 @@ --- module: nbde_client_clevis short_description: Handle clevis-related operations on LUKS devices -version_added: "2.9" description: - "WARNING: Do not use this module directly! It is only for role internal use." - "Module manages clevis bindings on encrypted devices to match the state @@ -26,6 +25,7 @@ either added or removed from a given device/slot. It supports the following keys: type: list + elements: dict suboptions: device: description: @@ -88,13 +88,12 @@ - http://server1.example.com - http://server2.example.com - - name: Remove binding from slot 2 in /dev/sda1 nbde_client_bindings: - - device: /dev/sda1 - encryption_password: password - slot: 2 - state: absent + - device: /dev/sda1 + encryption_password: password + slot: 2 + state: absent """ RETURN = """ @@ -1593,7 +1592,7 @@ def run_module(): """The entry point of the module.""" module_args = dict( - bindings=dict(type="list", required=False), + bindings=dict(type="list", elements="dict", required=False), data_dir=dict(type="str", required=False), ) diff --git a/tests/roles/caller/tasks/main.yml b/tests/roles/caller/tasks/main.yml index ae5e81d..813b2ae 100644 --- a/tests/roles/caller/tasks/main.yml +++ b/tests/roles/caller/tasks/main.yml @@ -1,8 +1,10 @@ --- # tasks file for caller -- include_role: +- name: Call role + include_role: name: "{{ roletoinclude }}" -- assert: +- name: Assert variable not overridden + assert: that: not __caller_override diff --git a/tests/tests_include_vars_from_parent.yml b/tests/tests_include_vars_from_parent.yml index 92b3982..d8235ce 100644 --- a/tests/tests_include_vars_from_parent.yml +++ b/tests/tests_include_vars_from_parent.yml @@ -1,5 +1,5 @@ --- -- name: Test role variable override +- name: Test role include variable override hosts: all gather_facts: true tasks: @@ -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.nbde_client + + - name: Cleanup + file: + path: "{{ item.dest }}" + state: absent + loop: "{{ __varfiles_created.results }}" + delegate_to: localhost + when: inventory_hostname == ansible_play_hosts_all[0]