1
0
Fork 0

Change port of ssh

This commit is contained in:
Florian RICHER 2023-05-21 16:03:37 +02:00
parent 7adf079b23
commit 1419a89d03
4 changed files with 22 additions and 0 deletions

View file

@ -4,6 +4,7 @@
roles:
- { role: docker, tags: ["docker"] }
- { role: ssh, tags: ["ssh"] }
- { role: traefik, tags: ["traefik"] }
- { role: whoami, tags: ["whoami"] }
- { role: protonmail, tags: ["protonmail"] }

14
roles/ssh/tasks/base.yml Normal file
View file

@ -0,0 +1,14 @@
---
- name: Copy conf
ansible.builtin.template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
group: root
mode: u=rwx,g=rx,o=rx
loop:
- { src: 'port.conf.j2', dest: '/etc/ssh/ssh_config.d/99-port.conf' }
register: iptables_templates_results
become: yes
# TODO: Reload ssh configuration and reconnect to new port

4
roles/ssh/tasks/main.yml Normal file
View file

@ -0,0 +1,4 @@
---
- ansible.builtin.import_tasks: base.yml
name: base

View file

@ -0,0 +1,3 @@
# Change default port of ssh config
Port {{ server.ssh_port }}