infrastructure/ansible/roles/ssh-bastion/tasks/main.yml

27 lines
480 B
YAML
Raw Normal View History

2019-12-08 16:03:13 +00:00
- name: Instal OpenSSH
apt:
name: openssh-server
become: true
become_user: root
2019-12-08 15:55:19 +00:00
- name: Define context
set_fact:
user: jake
enable_root: true
- name: SSH config
template:
src: files/ssh/sshd_config_bastion
dest: /etc/ssh/sshd_config
validate: /usr/sbin/sshd -t -f %s
backup: yes
become: true
become_user: root
register: sshd_config
- name: Restart SSH config
service:
name: sshd
state: reloaded
when: sshd_config.changed