1
0
Fork 0
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:
L3D 2019-02-20 11:54:02 +01:00
parent 6ecf1ca01a
commit 7282b39ca3
2 changed files with 14 additions and 3 deletions

View file

@ -2,11 +2,15 @@
- name: register os-specific variables - name: register os-specific variables
include_vars: default.yml include_vars: default.yml
when: ansible_distribution != 'Fedora' when:
- ansible_distribution != 'Fedora'
- ansible_distribution != 'Archlinux'
- name: register os-specific variables - name: register os-specific variables
include_vars: "{{ ansible_distribution }}.yml" 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 - name: Collect all users and groups allowed to login via ssh
@ -23,6 +27,7 @@
group: root group: root
mode: 'u=rw,g=r,o=r' mode: 'u=rw,g=r,o=r'
validate: /usr/sbin/sshd -t -f %s validate: /usr/sbin/sshd -t -f %s
become: yes
notify: notify:
- restart ssh - restart ssh
@ -32,10 +37,10 @@
args: args:
chdir: '/etc/ssh/' chdir: '/etc/ssh/'
creates: 'ssh_host_ed25519_key.pub' creates: 'ssh_host_ed25519_key.pub'
become: yes
notify: notify:
- restart ssh - restart ssh
- name: Remove unwanted host keys - name: Remove unwanted host keys
file: file:
path: '/etc/ssh/ssh_host_{{ item }}_key' path: '/etc/ssh/ssh_host_{{ item }}_key'
@ -44,6 +49,7 @@
- ecdsa - ecdsa
- rsa - rsa
- dsa - dsa
become: yes
notify: notify:
- restart ssh - restart ssh
@ -54,6 +60,7 @@
- ecdsa - ecdsa
- rsa - rsa
- dsa - dsa
become: yes
notify: notify:
- restart ssh - restart ssh

4
vars/Archlinux.yml Normal file
View file

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