summaryrefslogtreecommitdiff
path: root/roles/sshd/tasks/main.yml
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2022-09-04 10:04:27 +0300
committerLars Wirzenius <liw@liw.fi>2022-09-04 10:04:27 +0300
commit22ba6cecc6bdc370f36ea2a71077aa3f8a9e2f67 (patch)
tree94b7dae9b801adf0e3e82b5d9d693d19abcc6f89 /roles/sshd/tasks/main.yml
parente830e74c4ae4bb34e1e041b8e55ddc1511407392 (diff)
downloaddebian-ansible-22ba6cecc6bdc370f36ea2a71077aa3f8a9e2f67.tar.gz
fix: drop adding hostname to /etc/hosts as an alias for 127.0.0.1
It doesn't seem to serve any useful purpose, but it bothers a Puomi router then servers 127.0.0.1 as its own address to its DHCP clients. Sponsored-by: author
Diffstat (limited to 'roles/sshd/tasks/main.yml')
-rw-r--r--roles/sshd/tasks/main.yml24
1 files changed, 24 insertions, 0 deletions
diff --git a/roles/sshd/tasks/main.yml b/roles/sshd/tasks/main.yml
index e601969..3855e30 100644
--- a/roles/sshd/tasks/main.yml
+++ b/roles/sshd/tasks/main.yml
@@ -32,6 +32,30 @@
dest: /etc/ssh/sshd_config.d/host_id.conf
notify: sshd_restart
+- name: "Remove old host key settings from /etc/ssh/sshd_config"
+ when: sshd_host_key is defined and sshd_host_cert is defined
+ lineinfile:
+ path: /etc/ssh/sshd_config
+ state: absent
+ regex: "(?i)hostkey"
+ notify: sshd_restart
+
+- name: "Remove old host cert settings from /etc/ssh/sshd_config"
+ when: sshd_host_key is defined and sshd_host_cert is defined
+ lineinfile:
+ path: /etc/ssh/sshd_config
+ state: absent
+ regex: "(?i)hostcertificate"
+ notify: sshd_restart
+
+- name: "Remove old user CA settings from /etc/ssh/sshd_config"
+ when: sshd_host_key is defined and sshd_host_cert is defined
+ lineinfile:
+ path: /etc/ssh/sshd_config
+ state: absent
+ regex: "(?i)trustedusercakeys"
+ notify: sshd_restart
+
- name: "Remove obsolete SSH host keys and certificates"
when: sshd_host_key is defined and sshd_host_cert is defined
shell: |