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:
parent
0febef54bd
commit
99519f3ced
1 changed files with 13 additions and 13 deletions
|
@ -19,19 +19,6 @@
|
||||||
sshd_allowed_users: '{{ sshd.allowed_users + users.keys() | default({}) | sort }}'
|
sshd_allowed_users: '{{ sshd.allowed_users + users.keys() | default({}) | sort }}'
|
||||||
sshd_allowed_groups: '{{ sshd.allowed_groups + 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
|
- name: Generate new ssh host key pair if necessary
|
||||||
become: yes
|
become: yes
|
||||||
command: ssh-keygen -t ecdsa -f 'ssh_host_{{ item }}_key' -P '' -q
|
command: ssh-keygen -t ecdsa -f 'ssh_host_{{ item }}_key' -P '' -q
|
||||||
|
@ -74,3 +61,16 @@
|
||||||
- "{{ sshd_key_types_list | difference( sshd.key_types ) }}"
|
- "{{ sshd_key_types_list | difference( sshd.key_types ) }}"
|
||||||
notify:
|
notify:
|
||||||
- systemctrl restart ssh
|
- 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
|
||||||
|
|
Loading…
Reference in a new issue