1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_sshd.git synced 2024-08-16 11:59:49 +02:00

On Fedora it is sshd

This commit is contained in:
L3D 2018-11-16 11:44:36 +01:00
parent 9985bd4a9e
commit 61bcf5fb59
4 changed files with 22 additions and 3 deletions

View file

@ -1,5 +1,5 @@
---
- name: restart ssh
service:
name: ssh
name: "{{ ssh_service }}"
state: restarted

View file

@ -1,8 +1,18 @@
---
- name: register os-specific variables
include_vars: default.yml
when: ansible_distribution != 'Fedora'
- name: register os-specific variables
include_vars: "{{ ansible_distribution }}.yml"
when: ansible_distribution == 'Fedora'
- name: Collect all users and groups allowed to login via ssh
set_fact:
sshd_allow_users: '{{ ["root"] + users.keys() | default({}) | sort }}'
sshd_allow_groups: '{{ ["root"] + users.keys() | default({}) | sort }}'
sshd_allow_users: '{{ ["root", "ansible"] + users.keys() | default({}) | sort }}'
sshd_allow_groups: '{{ ["root", "admins"] + users.keys() | default({}) | sort }}'
- name: Copy sshd configuration
@ -45,3 +55,4 @@
- dsa
notify:
- restart ssh

4
vars/Fedora.yml Normal file
View file

@ -0,0 +1,4 @@
---
ssh_service: sshd

4
vars/default.yml Normal file
View file

@ -0,0 +1,4 @@
---
ssh_service: ssh