@@ -173,23 +173,6 @@ resource "null_resource" "bastion" {
173173 private_key = tls_private_key. ssh . private_key_pem
174174 }
175175 }
176-
177-
178- provisioner "remote-exec" {
179- inline = [
180- " #!/bin/bash" ,
181- " chmod 600 /home/${ var . bastion_username } /.ssh/cluster.key" ,
182- " cp /home/${ var . bastion_username } /.ssh/cluster.key /home/${ var . bastion_username } /.ssh/id_rsa" ,
183- " chmod a+x /opt/oci-hpc/bin/*.sh" ,
184- " timeout --foreground 60m /opt/oci-hpc/bin/bastion.sh"
185- ]
186- connection {
187- host = local. host
188- type = " ssh"
189- user = var. bastion_username
190- private_key = tls_private_key. ssh . private_key_pem
191- }
192- }
193176}
194177resource "null_resource" "cluster" {
195178 depends_on = [null_resource. bastion , null_resource. backup , oci_core_cluster_network . cluster_network , oci_core_instance . bastion , oci_core_volume_attachment . bastion_volume_attachment ]
@@ -438,6 +421,10 @@ provisioner "file" {
438421 provisioner "remote-exec" {
439422 inline = [
440423 " #!/bin/bash" ,
424+ " chmod 600 /home/${ var . bastion_username } /.ssh/cluster.key" ,
425+ " cp /home/${ var . bastion_username } /.ssh/cluster.key /home/${ var . bastion_username } /.ssh/id_rsa" ,
426+ " chmod a+x /opt/oci-hpc/bin/*.sh" ,
427+ " timeout --foreground 60m /opt/oci-hpc/bin/bastion.sh" ,
441428 " chmod 755 /opt/oci-hpc/autoscaling/crontab/*.sh" ,
442429 " chmod 600 /opt/oci-hpc/autoscaling/credentials/key.pem" ,
443430 " echo ${ var . configure } > /tmp/configure.conf" ,
0 commit comments