diff --git a/defaults/main.yml b/defaults/main.yml index 58a0a5ba..9ca4193c 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -769,6 +769,12 @@ nova_pki_console_install_certificates: mode: "0640" condition: "{{ nova_pki_console_condition | bool }}" +# Extra settings which will be applied for `nova` user for offline +# migrations and resizes. Example: +# nova_ssh_custom_config: +# Port: 2022 +nova_ssh_custom_config: {} + # host which holds the ssh certificate authority nova_ssh_keypairs_setup_host: "{{ openstack_ssh_keypairs_setup_host | default('localhost') }}" diff --git a/files/ssh_config b/files/ssh_config deleted file mode 100644 index f30d239b..00000000 --- a/files/ssh_config +++ /dev/null @@ -1,2 +0,0 @@ -Host * - StrictHostKeyChecking no diff --git a/releasenotes/notes/custom_ssh_config-46c443e077b3386b.yaml b/releasenotes/notes/custom_ssh_config-46c443e077b3386b.yaml new file mode 100644 index 00000000..0ffee560 --- /dev/null +++ b/releasenotes/notes/custom_ssh_config-46c443e077b3386b.yaml @@ -0,0 +1,7 @@ +--- +features: + - | + Added variable ``nova_ssh_custom_config`` which allows to apply + extra configuration for SSH connection established by Nova Compute + while perfroming offline migrations or resizes. + Can be leveraged to define a custom SSH port or ProxyJump. diff --git a/tasks/nova_compute.yml b/tasks/nova_compute.yml index 0d7f36a7..341afe25 100644 --- a/tasks/nova_compute.yml +++ b/tasks/nova_compute.yml @@ -23,8 +23,8 @@ - always - name: Create the nova SSH config file - copy: - src: "ssh_config" + template: + src: "ssh_config.j2" dest: "{{ nova_system_home_folder }}/.ssh/config" owner: "{{ nova_system_user_name }}" group: "{{ nova_system_user_name }}" diff --git a/templates/ssh_config.j2 b/templates/ssh_config.j2 new file mode 100644 index 00000000..b8e994cf --- /dev/null +++ b/templates/ssh_config.j2 @@ -0,0 +1,5 @@ +Host * + StrictHostKeyChecking no +{% for key, value in nova_ssh_custom_config.items() %} + {{ key }} {{ value }} +{% endfor %}