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

Commit

Permalink
fix package install in tests
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Gumprich <[email protected]>
  • Loading branch information
Sebastian Gumprich committed Jul 6, 2020
1 parent 5b96f66 commit 4442447
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 41 deletions.
44 changes: 24 additions & 20 deletions tests/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,43 +7,47 @@
ansible_python_interpreter: /usr/bin/python3
when: ansible_facts.distribution == 'Fedora'

- package:
name: "{{ packages }}"
state: present
vars:
packages:
- yum:
name:
- openssh-clients
- openssh-server
- libselinux-python
state: present
update_cache: true
ignore_errors: true

- dnf:
name:
- openssh-clients
- openssh-server
state: present
update_cache: true
ignore_errors: true

- apt:
name: "{{ packages }}"
state: present
- apt:
name:
- openssh-client
- openssh-server
state: present
update_cache: true
vars:
packages:
- "openssh-client"
- "openssh-server"
ignore_errors: true

- file:
path: "/var/run/sshd"
- file:
path: "/var/run/sshd"
state: directory


- pacman: name="{{packages}}" state=present update_cache=true
vars:
packages:
- pacman:
name:
- "openssh"
- "awk"
state: present
update_cache: true
ignore_errors: true

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

roles:
- ansible-ssh-hardening
48 changes: 27 additions & 21 deletions tests/default_custom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,46 @@
ansible_python_interpreter: /usr/bin/python3
when: ansible_facts.distribution == 'Fedora'

- package:
name: "{{ packages }}"
state: present
vars:
packages:
- yum:
name:
- openssh-clients
- openssh-server
- libselinux-python
state: present
update_cache: true
ignore_errors: true

- dnf:
name:
- openssh-clients
- openssh-server
state: present
update_cache: true
ignore_errors: true

- apt:
name: "{{ packages }}"
state: present

- apt:
name:
- openssh-client
- openssh-server
state: present
update_cache: true
vars:
packages:
- "openssh-client"
- "openssh-server"
ignore_errors: true
- file:
path: "/var/run/sshd"

- file:
path: "/var/run/sshd"
state: directory

- pacman: name="{{packages}}" state=present update_cache=true
vars:
packages:

- pacman:
name:
- "openssh"
- "awk"
state: present
update_cache: true
ignore_errors: true

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

Expand Down

0 comments on commit 4442447

Please sign in to comment.