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

fix task order

This commit is contained in:
L3D 2020-04-13 17:59:47 +02:00
parent 0febef54bd
commit 99519f3ced
Signed by: l3d
GPG key ID: CD08445BFF4313D1

View file

@ -19,19 +19,6 @@
sshd_allowed_users: '{{ sshd.allowed_users + users.keys() | default({}) | sort }}'
sshd_allowed_groups: '{{ sshd.allowed_groups + users.keys() | default({}) | sort }}'
- name: Copy sshd configuration
become: yes
template:
src: sshd_config.j2
dest: '/etc/ssh/sshd_config'
owner: root
group: root
mode: 'u=rw,g=r,o=r'
validate: /usr/sbin/sshd -t -f %s
backup: yes
notify:
- systemctrl restart ssh
- name: Generate new ssh host key pair if necessary
become: yes
command: ssh-keygen -t ecdsa -f 'ssh_host_{{ item }}_key' -P '' -q
@ -74,3 +61,16 @@
- "{{ sshd_key_types_list | difference( sshd.key_types ) }}"
notify:
- systemctrl restart ssh
- name: Copy sshd configuration
become: yes
template:
src: sshd_config.j2
dest: '/etc/ssh/sshd_config'
owner: root
group: root
mode: 'u=rw,g=r,o=r'
validate: /usr/sbin/sshd -t -f %s
backup: yes
notify:
- systemctrl restart ssh