Skip to content

Commit

Permalink
Improve installing packages on Arch Linux
Browse files Browse the repository at this point in the history
This prevents annoying task errors (even though they are ignored)
when testing on non-Arch distributions.

Running the "prepare" command, this was always visible:
> fatal: [instance]: FAILED! => {"changed": false, "msg": "Failed to find required executable \"pacman\" in paths: /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin"}
  • Loading branch information
darxriggs committed Nov 7, 2021
1 parent c9c6819 commit ddc4685
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions molecule/os_hardening/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
- procps-ng
when: ansible_facts.distribution == 'Fedora'

- name: install packages
- name: install required tools on Arch
pacman:
name:
- "awk"
- awk
state: present
update_cache: true
ignore_errors: true
when: ansible_facts.os_family == 'Archlinux'

- name: install required tools on RHEL
yum:
Expand Down
8 changes: 4 additions & 4 deletions molecule/ssh_hardening/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@
- "openssh"
when: ansible_facts.os_family == 'Suse'

- name: install packages
- name: install required tools on Arch
pacman:
name:
- "openssh"
- "awk"
- openssh
- awk
state: present
update_cache: true
ignore_errors: true
when: ansible_facts.os_family == 'Archlinux'

- name: created needed directory
file:
Expand Down
8 changes: 4 additions & 4 deletions molecule/ssh_hardening_custom_tests/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@
- "openssh"
when: ansible_facts.os_family == 'Suse'

- name: install packages
- name: install required tools on Arch
pacman:
name:
- "openssh"
- "awk"
- openssh
- awk
state: present
update_cache: true
ignore_errors: true
when: ansible_facts.os_family == 'Archlinux'

- name: created needed directory
file:
Expand Down

0 comments on commit ddc4685

Please sign in to comment.