@@ -264,10 +264,16 @@ resource "openstack_compute_instance_v2" "login" {
264264 user_data = <<-EOF
265265 #cloud-config
266266 ssh_authorized_keys:
267+ {%- if cluster_user_ssh_public_key is defined %}
268+ - {{ cluster_user_ssh_public_key }}
269+ {%- endif %}
270+ {%- if cluster_deploy_ssh_public_key is defined %}
271+ - {{ cluster_deploy_ssh_public_key }}
272+ {%- endif %}
267273 {%- if cluster_ssh_private_key_file is not defined %}
268274 - " ${openstack_compute_keypair_v2.cluster_keypair.public_key}"
269275 {%- endif %}
270- {%- for ssh_key in cluster_deploy_ssh_keys %}
276+ {%- for ssh_key in cluster_deploy_ssh_keys_extra %}
271277 - {{ ssh_key }}
272278 {%- endfor %}
273279 EOF
@@ -315,10 +321,16 @@ resource "openstack_compute_instance_v2" "control" {
315321 user_data = <<-EOF
316322 #cloud-config
317323 ssh_authorized_keys:
324+ {%- if cluster_user_ssh_public_key is defined %}
325+ - {{ cluster_user_ssh_public_key }}
326+ {%- endif %}
327+ {%- if cluster_deploy_ssh_public_key is defined %}
328+ - {{ cluster_deploy_ssh_public_key }}
329+ {%- endif %}
318330 {%- if cluster_ssh_private_key_file is not defined %}
319331 - " ${openstack_compute_keypair_v2.cluster_keypair.public_key}"
320332 {%- endif %}
321- {%- for ssh_key in cluster_deploy_ssh_keys %}
333+ {%- for ssh_key in cluster_deploy_ssh_keys_extra %}
322334 - {{ ssh_key }}
323335 {%- endfor %}
324336 fs_setup:
@@ -352,10 +364,16 @@ resource "openstack_compute_instance_v2" "{{ partition.name }}" {
352364 user_data = <<-EOF
353365 #cloud-config
354366 ssh_authorized_keys:
367+ {%- if cluster_user_ssh_public_key is defined %}
368+ - {{ cluster_user_ssh_public_key }}
369+ {%- endif %}
370+ {%- if cluster_deploy_ssh_public_key is defined %}
371+ - {{ cluster_deploy_ssh_public_key }}
372+ {%- endif %}
355373 {%- if cluster_ssh_private_key_file is not defined %}
356374 - " ${openstack_compute_keypair_v2.cluster_keypair.public_key}"
357375 {%- endif %}
358- {%- for ssh_key in cluster_deploy_ssh_keys %}
376+ {%- for ssh_key in cluster_deploy_ssh_keys_extra %}
359377 - {{ ssh_key }}
360378 {%- endfor %}
361379 EOF
0 commit comments