Refactor roles to support new variable schema
Add common-env and docker roles
This commit is contained in:
14
roles/sshd/tasks/install.yml
Normal file
14
roles/sshd/tasks/install.yml
Normal file
@@ -0,0 +1,14 @@
|
||||
---
|
||||
- name: Install OpenSSH server on Fedora and CentOS 8
|
||||
when: ansible_distribution == "Fedora" or (ansible_distribution == "CentOS" and ansible_distribution_major_version == "8")
|
||||
become: true
|
||||
dnf:
|
||||
name: openssh-server
|
||||
state: latest
|
||||
|
||||
- name: Install OpenSSH server on CentOS 7
|
||||
when: ansible_distribution == "CentOS" and ansible_distribution_major_version == "7"
|
||||
become: true
|
||||
yum:
|
||||
name: openssh-server
|
||||
state: latest
|
@@ -1,4 +1,6 @@
|
||||
---
|
||||
- import_tasks: install.yml
|
||||
|
||||
- name: Install SSH Banner
|
||||
become: true
|
||||
template:
|
||||
@@ -26,8 +28,8 @@
|
||||
set: "ChallengeResponseAuthentication no"
|
||||
|
||||
- name: Restart sshd service
|
||||
when: omni_restart_services == true
|
||||
become: true
|
||||
systemd:
|
||||
name: sshd
|
||||
state: restarted
|
||||
state: "{{ 'restarted' if omni_restart_services == true else 'started' }}"
|
||||
enabled: "{{ omni_ssh_enabled }}"
|
||||
|
Reference in New Issue
Block a user