COnfigure SSH bastion
This commit is contained in:
20
ansible/roles/ssh-bastion/tasks/main.yml
Normal file
20
ansible/roles/ssh-bastion/tasks/main.yml
Normal file
@ -0,0 +1,20 @@
|
||||
- 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
|
Reference in New Issue
Block a user