Refactor roles to support new variable schema

Add common-env and docker roles
This commit is contained in:
2020-03-17 22:51:10 -04:00
parent 1f3ca79d04
commit dc1395daf1
14 changed files with 144 additions and 112 deletions

View File

@@ -1,2 +1,3 @@
---
omni_restart_services: false
omni_ssh_enabled: true

View 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

View File

@@ -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 }}"