Skip to content

Commit

Permalink
updated ansible fact naming and checkout action (#64)
Browse files Browse the repository at this point in the history
* updated ansible fact naming for ansible_facts.virtualization_type

Signed-off-by: Mark Bolwell <[email protected]>

* updated checkout version

Signed-off-by: Mark Bolwell <[email protected]>

* ansible fact update

Signed-off-by: Mark Bolwell <[email protected]>

* updated ansible facts and timeout now inherited

Signed-off-by: Mark Bolwell <[email protected]>

---------

Signed-off-by: Mark Bolwell <[email protected]>
  • Loading branch information
uk-bolly authored Mar 14, 2024
1 parent b238cf5 commit 0c20b83
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/devel_pipeline_validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@

steps:
- name: Clone ${{ github.event.repository.name }}
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

# Pull in terraform code for linux servers
- name: Clone github IaC plan
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: ansible-lockdown/github_linux_IaC
path: .github/workflows/github_linux_IaC
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main_pipeline_validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@

steps:
- name: Clone ${{ github.event.repository.name }}
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

# Pull in terraform code for linux servers
- name: Clone github IaC plan
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: ansible-lockdown/github_linux_IaC
path: .github/workflows/github_linux_IaC
Expand Down
4 changes: 2 additions & 2 deletions tasks/LE_audit_setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
- name: Pre Audit Setup | Set audit package name | 64bit
ansible.builtin.set_fact:
audit_pkg_arch_name: AMD64
when: ansible_machine == "x86_64"
when: ansible_facts.machine == "x86_64"

- name: Pre Audit Setup | Set audit package name | ARM64
ansible.builtin.set_fact:
audit_pkg_arch_name: ARM64
when: ansible_machine == "arm64"
when: ansible_facts.machine == "arm64"

- name: Pre Audit Setup | Download audit binary
ansible.builtin.get_url:
Expand Down
2 changes: 1 addition & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
- name: Setup rules if 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"]
block:
- name: Discover and set container variable if required
ansible.builtin.set_fact:
Expand Down
4 changes: 2 additions & 2 deletions templates/ansible_vars_goss.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
benchmark_version: '1.0.0'

# If run via script this is discovered and set
host_os_distribution: {{ ansible_distribution | lower }}
host_os_distribution: {{ ansible_facts.distribution | lower }}

# timeout for each command to run where set - default = 10seconds/10000ms
timeout_ms: 60000
timeout_ms: {{ audit_cmd_timeout }}
amzn2023cis_run_heavy_tests: {{ audit_run_heavy_tests }}

amzn2023cis_section1: {{ amzn2023cis_section1 }}
Expand Down

0 comments on commit 0c20b83

Please sign in to comment.