mirror of
https://github.com/ansible-lockdown/RHEL9-CIS.git
synced 2025-12-27 15:33:06 +00:00
Fix inject_facts_as_vars
Also enabled testing of this in CI to prevent regressions. See: - https://docs.ansible.com/ansible/2.9/reference_appendices/config.html#inject-facts-as-vars - https://github.com/ansible-lockdown/RHEL9-CIS/pull/54 Signed-off-by: Will Szumski <will@stackhpc.com>
This commit is contained in:
parent
50c8945565
commit
4cbbf8dfd8
3 changed files with 4 additions and 4 deletions
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
- name: Check OS version and family
|
||||
ansible.builtin.assert:
|
||||
that: (ansible_facts.distribution != 'CentOS' and ansible_os_family == 'RedHat' or ansible_os_family == "Rocky") and ansible_facts.distribution_major_version is version_compare('9', '==')
|
||||
that: (ansible_facts.distribution != 'CentOS' and ansible_facts.os_family == 'RedHat' or ansible_facts.os_family == "Rocky") and ansible_facts.distribution_major_version is version_compare('9', '==')
|
||||
fail_msg: "This role can only be run against Supported OSs. {{ ansible_facts.distribution }} {{ ansible_facts.distribution_major_version }} is not supported."
|
||||
success_msg: "This role is running against a supported OS {{ ansible_facts.distribution }} {{ ansible_facts.distribution_major_version }}"
|
||||
when:
|
||||
|
|
@ -83,7 +83,7 @@
|
|||
- system_is_container
|
||||
when:
|
||||
- ansible_connection == 'docker' or
|
||||
ansible_virtualization_type in ["docker", "lxc", "openvz", "podman", "container"]
|
||||
ansible_facts.virtualization_type in ["docker", "lxc", "openvz", "podman", "container"]
|
||||
tags:
|
||||
- container_discovery
|
||||
- always
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@
|
|||
|
||||
- name: "PRELIM | Section 1.1 | Create list of mount points"
|
||||
ansible.builtin.set_fact:
|
||||
mount_names: "{{ ansible_mounts | map(attribute='mount') | list }}"
|
||||
mount_names: "{{ ansible_facts.mounts | map(attribute='mount') | list }}"
|
||||
tags:
|
||||
- level1-server
|
||||
- level1-workstation
|
||||
|
|
|
|||
|
|
@ -16,4 +16,4 @@ rhel9cis_allowed_crypto_policies_modules:
|
|||
warn_control_list: ""
|
||||
warn_count: 0
|
||||
|
||||
gpg_key_package: "{{ ansible_distribution | lower }}-gpg-keys"
|
||||
gpg_key_package: "{{ ansible_facts.distribution | lower }}-gpg-keys"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue