base_config: disable cloud-init ssh module to avoid hostkey regeneration
Some checks failed
/ Ansible Lint (push) Failing after 1m55s
Some checks failed
/ Ansible Lint (push) Failing after 1m55s
It should run once on first boot anyway and since it apparently runs for every change in the Proxmox cloud init config, disable it, so it doesn't, since it's annoying to have "random" hostkey changes.
This commit is contained in:
parent
80ddb2efc9
commit
fbd3ea5496
1 changed files with 13 additions and 0 deletions
13
roles/base_config/tasks/main.yaml
Normal file
13
roles/base_config/tasks/main.yaml
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
# Ensure the ssh module is disabled, so a cloud-init config change doesn't regenerate the host keys for no reason.
|
||||||
|
- name: check if cloud-init config file exists
|
||||||
|
ansible.builtin.stat:
|
||||||
|
path: /etc/cloud/cloud.cfg
|
||||||
|
register: base_config__stat_cloud_cfg
|
||||||
|
|
||||||
|
- name: ensure the cloud-init ssh module is disabled
|
||||||
|
ansible.builtin.replace:
|
||||||
|
path: /etc/cloud/cloud.cfg
|
||||||
|
regexp: " - ssh$"
|
||||||
|
replace: " #- ssh"
|
||||||
|
become: true
|
||||||
|
when: base_config__stat_cloud_cfg.stat.exists
|
||||||
Loading…
Add table
Add a link
Reference in a new issue