Skip to content
This repository was archived by the owner on Dec 26, 2020. It is now read-only.

Commit 22580d8

Browse files
authored
Merge pull request #301 from dev-sec/fix_fedora_tests
fix package install in tests
2 parents 64b86d4 + 4442447 commit 22580d8

File tree

2 files changed

+51
-41
lines changed

2 files changed

+51
-41
lines changed

tests/default.yml

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,43 +7,47 @@
77
ansible_python_interpreter: /usr/bin/python3
88
when: ansible_facts.distribution == 'Fedora'
99

10-
- package:
11-
name: "{{ packages }}"
12-
state: present
13-
vars:
14-
packages:
10+
- yum:
11+
name:
1512
- openssh-clients
1613
- openssh-server
1714
- libselinux-python
15+
state: present
16+
update_cache: true
17+
ignore_errors: true
18+
19+
- dnf:
20+
name:
21+
- openssh-clients
22+
- openssh-server
23+
state: present
24+
update_cache: true
1825
ignore_errors: true
1926

20-
- apt:
21-
name: "{{ packages }}"
22-
state: present
27+
- apt:
28+
name:
29+
- openssh-client
30+
- openssh-server
31+
state: present
2332
update_cache: true
24-
vars:
25-
packages:
26-
- "openssh-client"
27-
- "openssh-server"
2833
ignore_errors: true
2934

30-
- file:
31-
path: "/var/run/sshd"
35+
- file:
36+
path: "/var/run/sshd"
3237
state: directory
33-
3438

35-
- pacman: name="{{packages}}" state=present update_cache=true
36-
vars:
37-
packages:
39+
- pacman:
40+
name:
3841
- "openssh"
3942
- "awk"
43+
state: present
44+
update_cache: true
4045
ignore_errors: true
4146

4247
- name: create ssh host keys
4348
command: "ssh-keygen -A"
44-
when: not ((ansible_facts.os_family in ['Oracle Linux', 'RedHat']) and ansible_facts.distribution_major_version < '7') or
49+
when: not ((ansible_facts.os_family in ['Oracle Linux', 'RedHat']) and ansible_facts.distribution_major_version < '7') or
4550
ansible_facts.distribution == "Fedora" or
4651
ansible_facts.distribution == "Amazon"
47-
4852
roles:
4953
- ansible-ssh-hardening

tests/default_custom.yml

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,40 +7,46 @@
77
ansible_python_interpreter: /usr/bin/python3
88
when: ansible_facts.distribution == 'Fedora'
99

10-
- package:
11-
name: "{{ packages }}"
12-
state: present
13-
vars:
14-
packages:
10+
- yum:
11+
name:
1512
- openssh-clients
1613
- openssh-server
1714
- libselinux-python
15+
state: present
16+
update_cache: true
17+
ignore_errors: true
18+
19+
- dnf:
20+
name:
21+
- openssh-clients
22+
- openssh-server
23+
state: present
24+
update_cache: true
1825
ignore_errors: true
19-
20-
- apt:
21-
name: "{{ packages }}"
22-
state: present
26+
27+
- apt:
28+
name:
29+
- openssh-client
30+
- openssh-server
31+
state: present
2332
update_cache: true
24-
vars:
25-
packages:
26-
- "openssh-client"
27-
- "openssh-server"
2833
ignore_errors: true
29-
30-
- file:
31-
path: "/var/run/sshd"
34+
35+
- file:
36+
path: "/var/run/sshd"
3237
state: directory
33-
34-
- pacman: name="{{packages}}" state=present update_cache=true
35-
vars:
36-
packages:
38+
39+
- pacman:
40+
name:
3741
- "openssh"
3842
- "awk"
43+
state: present
44+
update_cache: true
3945
ignore_errors: true
4046

4147
- name: create ssh host keys
4248
command: "ssh-keygen -A"
43-
when: not ((ansible_facts.os_family in ['Oracle Linux', 'RedHat']) and ansible_facts.distribution_major_version < '7') or
49+
when: not ((ansible_facts.os_family in ['Oracle Linux', 'RedHat']) and ansible_facts.distribution_major_version < '7') or
4450
ansible_facts.distribution == "Fedora" or
4551
ansible_facts.distribution == "Amazon"
4652

0 commit comments

Comments
 (0)