Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion playbooks/roles/k8s_setup/tasks/k8s_setup_aks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
project_path: "{{ playbook_dir }}/../ascender_install_artifacts/aks_deploy"
state: present
variables:
home_dir: "/home/{{ ansible_user}}"
home_dir: "{{ ansible_env.HOME }}"
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ansible_env.HOME is only available when environment facts are gathered. This play/role disables normal fact gathering and the setup task in this file only gathers date_time, so ansible_env.HOME may be undefined and cause the same immediate failure you’re trying to avoid. Use lookup('env', 'HOME') or adjust the setup/fact gathering to include the env subset before using ansible_env.HOME.

Suggested change
home_dir: "{{ ansible_env.HOME }}"
home_dir: "{{ lookup('env', 'HOME') }}"

Copilot uses AI. Check for mistakes.
aks_cluster_name: "{{ AKS_CLUSTER_NAME }}"
resource_group_location: "{{ AKS_CLUSTER_REGION }}"
node_count: "{{ AKS_NUM_WORKER_NODES }}"
Expand Down
2 changes: 1 addition & 1 deletion playbooks/roles/k8s_setup/tasks/k8s_setup_gke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
project_path: "{{ playbook_dir }}/../ascender_install_artifacts/gke_deploy"
state: present
variables:
home_dir: "/home/{{ ansible_user}}"
home_dir: "{{ ansible_env.HOME }}"
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ansible_env.HOME will be undefined here unless the env fact subset is gathered. This role/play disables full fact gathering (playbooks/kubernetes_setup.yml sets gather_facts: no), and the only setup call in this task file gathers date_time only, so this change can still fail with an undefined-variable error. Consider using lookup('env', 'HOME') (works without facts for local connections) or expand the ansible.builtin.setup gather_subset to include env before referencing ansible_env.HOME.

Suggested change
home_dir: "{{ ansible_env.HOME }}"
home_dir: "{{ lookup('env', 'HOME') }}"

Copilot uses AI. Check for mistakes.
gke_cluster_name: "{{ GKE_CLUSTER_NAME }}"
kubernetes_version: "{{ GKE_K8S_VERSION }}"
project_id: "{{ GKE_PROJECT_ID }}"
Expand Down
Loading