File tree Expand file tree Collapse file tree
terraform-modules/openstack-kubernetes-infra Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11resource "null_resource" "copy_kubeconfig" {
22 depends_on = [openstack_compute_instance_v2 . kubernetes_server , null_resource. kubernetes_server_provisioner ]
33
4+ # Re-fetch kubeconfig whenever the controller is replaced (new cluster CA/certs).
5+ triggers = {
6+ server_id = openstack_compute_instance_v2.kubernetes_server.id
7+ ip_address = local.controller_host_instance.ip_address
8+ }
9+
410 provisioner "local-exec" {
511 # Copy the kubeconfig file from the host to a local file using SCP.
612 # Use ssh-keyscan to prevent interactive prompt on unknown host
7- # Use sed to replace the localhost address in the KUBECONFIG file with the actual IP adddress of the created VM.
13+ # Use sed to replace the localhost address in the KUBECONFIG file with the actual IP adddress of the created VM.
814 command = << EOT
915mkdir -p ${ path . root } /.build/ && \
1016ssh-keyscan -H ${ local . controller_host_instance . ip_address } >> ${ path . root } /.build/.known_hosts_cogstack && \
Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ check "controller_floating_ip_required_for_non_default_network" {
9898 assert {
9999 condition = (var. network == null
100100 || (var. network . name == " external_4003" && var. network . network_id == null )
101- || (length ([for host in var . host_instances : host if host . is_controller == true && host . floating_ip . use_floating_ip == true ]) == 1 ))
101+ || (length ([for host in var . host_instances : host if host . is_controller == true && host . floating_ip . use_floating_ip == true ]) == 1 ))
102102 error_message = <<- EOT
103103When using a non-default network, the controller host should have a floating IP in order to be accessible by the terraform agent
104104EOT
You can’t perform that action at this time.
0 commit comments