Change port of ssh
This commit is contained in:
parent
7adf079b23
commit
1419a89d03
4 changed files with 22 additions and 0 deletions
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
- { role: docker, tags: ["docker"] }
|
- { role: docker, tags: ["docker"] }
|
||||||
|
- { role: ssh, tags: ["ssh"] }
|
||||||
- { role: traefik, tags: ["traefik"] }
|
- { role: traefik, tags: ["traefik"] }
|
||||||
- { role: whoami, tags: ["whoami"] }
|
- { role: whoami, tags: ["whoami"] }
|
||||||
- { role: protonmail, tags: ["protonmail"] }
|
- { role: protonmail, tags: ["protonmail"] }
|
||||||
|
|
14
roles/ssh/tasks/base.yml
Normal file
14
roles/ssh/tasks/base.yml
Normal 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
4
roles/ssh/tasks/main.yml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
- ansible.builtin.import_tasks: base.yml
|
||||||
|
name: base
|
3
roles/ssh/templates/port.conf.j2
Normal file
3
roles/ssh/templates/port.conf.j2
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
# Change default port of ssh config
|
||||||
|
|
||||||
|
Port {{ server.ssh_port }}
|
Loading…
Reference in a new issue