Skip to content

Commit f1ec9f2

Browse files
author
Sebastian Gumprich
committed
install python3, pip so we can then install pam-tester
Signed-off-by: Sebastian Gumprich <[email protected]>
1 parent 8220ae9 commit f1ec9f2

File tree

3 files changed

+18
-20
lines changed

3 files changed

+18
-20
lines changed

molecule/os_hardening/prepare.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,18 @@
77
https_proxy: "{{ lookup('env', 'https_proxy') | default(omit) }}"
88
no_proxy: "{{ lookup('env', 'no_proxy') | default(omit) }}"
99
tasks:
10-
- name: set ansible_python_interpreter to "/usr/bin/python3" on fedora
11-
set_fact:
12-
ansible_python_interpreter: "/usr/bin/python3"
13-
when: ansible_facts.distribution == 'Fedora'
14-
15-
- name: Run the equivalent of "apt-get update && apt-get upgrade"
16-
apt:
17-
name: "*"
18-
state: latest
10+
- name: Install Python3 on Debian 10
11+
ansible.builtin.apt:
12+
name: python3
13+
state: present
1914
update_cache: true
2015
when: ansible_os_family == 'Debian'
2116

22-
- name: install required tools on SuSE
17+
- name: Set ansible_python_interpreter to "/usr/bin/python3"
18+
ansible.builtin.set_fact:
19+
ansible_python_interpreter: /usr/bin/python3
20+
21+
- name: Install required tools on SuSE
2322
# cannot use zypper module, since it depends on python-xml
2423
ansible.builtin.shell: zypper -n install python-xml
2524
when: ansible_facts.os_family == 'Suse'

molecule/os_hardening/verify.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,14 @@
2020
- verify_tasks/netrc.yml
2121
- verify_tasks/ignore_home_folders.yml
2222

23-
# temp. disabled - https://github.com/dev-sec/ansible-collection-hardening/issues/690
24-
# - name: include PAM tests
25-
# include_tasks: verify_tasks/pam.yml
26-
# when: ansible_facts.distribution in ['Debian', 'Ubuntu'] or ansible_facts.os_family == 'RedHat'
27-
28-
- name: include YUM tests
29-
include_tasks: verify_tasks/yum.yml
23+
- name: Include YUM tests
24+
ansible.builtin.include_tasks: verify_tasks/yum.yml
3025
when: ansible_facts.os_family == 'RedHat'
3126

27+
- name: Include PAM tests
28+
ansible.builtin.include_tasks: verify_tasks/pam.yml
29+
when: ansible_facts.distribution in ['Debian', 'Ubuntu'] or ansible_facts.os_family == 'RedHat'
30+
3231
- name: Verify
3332
hosts: localhost
3433
environment:

molecule/os_hardening/verify_tasks/pam.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
state: present
1313
executable: /usr/bin/pip3
1414

15-
- name: set password for test
16-
set_fact:
17-
test_pw: "myTest!pw"
15+
- name: Set password for test
16+
ansible.builtin.set_fact:
17+
test_pw: myTestpwSage
1818

1919
- name: Set locale for test
2020
ansible.builtin.set_fact:

0 commit comments

Comments
 (0)