mirror of
https://github.com/roles-ansible/ansible_role_sshd.git
synced 2024-08-16 11:59:49 +02:00
Arch support and use become: yes
This commit is contained in:
parent
6ecf1ca01a
commit
7282b39ca3
2 changed files with 14 additions and 3 deletions
|
@ -2,11 +2,15 @@
|
|||
|
||||
- name: register os-specific variables
|
||||
include_vars: default.yml
|
||||
when: ansible_distribution != 'Fedora'
|
||||
when:
|
||||
- ansible_distribution != 'Fedora'
|
||||
- ansible_distribution != 'Archlinux'
|
||||
|
||||
- name: register os-specific variables
|
||||
include_vars: "{{ ansible_distribution }}.yml"
|
||||
when: ansible_distribution == 'Fedora'
|
||||
when:
|
||||
- ansible_distribution == 'Fedora'
|
||||
- ansible_distribution == 'Archlinux'
|
||||
|
||||
|
||||
- name: Collect all users and groups allowed to login via ssh
|
||||
|
@ -23,6 +27,7 @@
|
|||
group: root
|
||||
mode: 'u=rw,g=r,o=r'
|
||||
validate: /usr/sbin/sshd -t -f %s
|
||||
become: yes
|
||||
notify:
|
||||
- restart ssh
|
||||
|
||||
|
@ -32,10 +37,10 @@
|
|||
args:
|
||||
chdir: '/etc/ssh/'
|
||||
creates: 'ssh_host_ed25519_key.pub'
|
||||
become: yes
|
||||
notify:
|
||||
- restart ssh
|
||||
|
||||
|
||||
- name: Remove unwanted host keys
|
||||
file:
|
||||
path: '/etc/ssh/ssh_host_{{ item }}_key'
|
||||
|
@ -44,6 +49,7 @@
|
|||
- ecdsa
|
||||
- rsa
|
||||
- dsa
|
||||
become: yes
|
||||
notify:
|
||||
- restart ssh
|
||||
|
||||
|
@ -54,6 +60,7 @@
|
|||
- ecdsa
|
||||
- rsa
|
||||
- dsa
|
||||
become: yes
|
||||
notify:
|
||||
- restart ssh
|
||||
|
||||
|
|
4
vars/Archlinux.yml
Normal file
4
vars/Archlinux.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
|
||||
ssh_service: sshd
|
||||
|
Loading…
Reference in a new issue