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

fix package install in tests #301

Merged
merged 1 commit into from
Jul 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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