diff --git a/.github/workflows/terraform-k8apps-apply.yaml b/.github/workflows/terraform-k8apps-apply.yaml index 293eedc..f809f89 100644 --- a/.github/workflows/terraform-k8apps-apply.yaml +++ b/.github/workflows/terraform-k8apps-apply.yaml @@ -95,8 +95,8 @@ jobs: run: | for HOST in $TRUSTED_HOSTS; do ssh -f -N -L 16443:localhost:16443 $ANSIBLE_USER@$HOST - # override hosts address in kube config - sed -i "s/server: https:\/\/$HOST:16443/server: https:\/\/localhost:16443/g" ~/.kube/config + IP_ADDR=$(ssh $ANSIBLE_USER@$HOST "hostname -I | cut -d' ' -f1") + sed -i "s/server: https:\/\/$IP_ADDR:16443/server: https:\/\/localhost:16443/g" ~/.kube/config cd terraform/k8sapps sectool exec terraform apply --auto-approve pkill -f "ssh -f -N -L 16443:localhost:16443 $ANSIBLE_USER@$HOST"