Skip to content

Commit 431c6f8

Browse files
ssimpson89claude
andauthored
Fix ansible_user undefined error in GKE and AKS Terraform tasks (#189)
When ansible_connection=local is used, ansible_user is never set and referencing it causes an immediate failure. Replace /home/{{ ansible_user }} with {{ ansible_env.HOME }} which resolves correctly in local connections. Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1 parent 086f4e0 commit 431c6f8

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

playbooks/roles/k8s_setup/tasks/k8s_setup_aks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
project_path: "{{ playbook_dir }}/../ascender_install_artifacts/aks_deploy"
7777
state: present
7878
variables:
79-
home_dir: "/home/{{ ansible_user}}"
79+
home_dir: "{{ ansible_env.HOME }}"
8080
aks_cluster_name: "{{ AKS_CLUSTER_NAME }}"
8181
resource_group_location: "{{ AKS_CLUSTER_REGION }}"
8282
node_count: "{{ AKS_NUM_WORKER_NODES }}"

playbooks/roles/k8s_setup/tasks/k8s_setup_gke.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
project_path: "{{ playbook_dir }}/../ascender_install_artifacts/gke_deploy"
8585
state: present
8686
variables:
87-
home_dir: "/home/{{ ansible_user}}"
87+
home_dir: "{{ ansible_env.HOME }}"
8888
gke_cluster_name: "{{ GKE_CLUSTER_NAME }}"
8989
kubernetes_version: "{{ GKE_K8S_VERSION }}"
9090
project_id: "{{ GKE_PROJECT_ID }}"

0 commit comments

Comments
 (0)