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:
parent
9985bd4a9e
commit
61bcf5fb59
4 changed files with 22 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
- name: restart ssh
|
||||
service:
|
||||
name: ssh
|
||||
name: "{{ ssh_service }}"
|
||||
state: restarted
|
||||
|
|
|
@ -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
4
vars/Fedora.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
|
||||
ssh_service: sshd
|
||||
|
4
vars/default.yml
Normal file
4
vars/default.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
|
||||
ssh_service: ssh
|
||||
|
Loading…
Reference in a new issue