2020-04-13 14:46:45 +02:00
|
|
|
---
|
|
|
|
# Configure OpenSSH server
|
|
|
|
- name: Configure OpenSSH server
|
|
|
|
template:
|
|
|
|
src: openssh/sshd_config.j2
|
|
|
|
dest: /etc/ssh/sshd_config
|
|
|
|
backup: yes
|
|
|
|
owner: "0"
|
|
|
|
group: "0"
|
|
|
|
mode: "0644"
|
|
|
|
validate: '/usr/sbin/sshd -T -f %s'
|
|
|
|
notify: restart openssh
|
|
|
|
|
2020-11-28 20:47:30 +01:00
|
|
|
- name: Trigger OpenSSH handlers
|
2020-04-13 14:46:45 +02:00
|
|
|
meta: flush_handlers
|
|
|
|
|
|
|
|
- name: Change Ansible SSH port to {{ openssh_port }}
|
|
|
|
set_fact:
|
|
|
|
ansible_port: "{{ openssh_port }}"
|
2020-11-28 20:47:30 +01:00
|
|
|
when: openssh_port != "22"
|