diff options
| author | Ahmed Abdelhalim <[email protected]> | 2026-01-24 16:24:28 +0100 |
|---|---|---|
| committer | Ahmed Abdelhalim <[email protected]> | 2026-01-24 16:24:28 +0100 |
| commit | 6d927c0f20f95dfb1ece8766dfaf34805bc2f820 (patch) | |
| tree | 7fcc3918e290e31309d74eb0b784fa6a00318ee3 /roles/rust/tasks/main.yml | |
| parent | b39722e58c1935f4d92c052cf89c941164150c35 (diff) | |
Fix ansible_facts to use only bracket notation instead of dot notation
Co-authored-by: claude.ai
Diffstat (limited to 'roles/rust/tasks/main.yml')
| -rw-r--r-- | roles/rust/tasks/main.yml | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/roles/rust/tasks/main.yml b/roles/rust/tasks/main.yml index 640e4785..69e6c557 100644 --- a/roles/rust/tasks/main.yml +++ b/roles/rust/tasks/main.yml @@ -1,7 +1,7 @@ --- - name: "Check if cargo binary exists" ansible.builtin.stat: - path: "{{ ansible_facts['env'].HOME }}/.cargo/bin/cargo" + path: "{{ ansible_facts['env']['HOME'] }}/.cargo/bin/cargo" register: rust_cargo_binary - name: "Download rustup installer" @@ -15,23 +15,23 @@ ansible.builtin.command: cmd: "/tmp/install_rustup.sh -y --default-toolchain {{ rust_toolchain }} --profile minimal" args: - creates: "{{ ansible_facts['env'].HOME }}/.cargo/bin/cargo" + creates: "{{ ansible_facts['env']['HOME'] }}/.cargo/bin/cargo" when: not rust_cargo_binary.stat.exists - name: "Ensure default toolchain is set" ansible.builtin.command: - cmd: "{{ ansible_facts['env'].HOME }}/.cargo/bin/rustup default {{ rust_toolchain }}" + cmd: "{{ ansible_facts['env']['HOME'] }}/.cargo/bin/rustup default {{ rust_toolchain }}" changed_when: false - name: "Remove cargo default shell profile modification" ansible.builtin.lineinfile: - path: "{{ ansible_facts['env'].HOME }}/.bashrc" + path: "{{ ansible_facts['env']['HOME'] }}/.bashrc" line: '. "$HOME/.cargo/env"' state: "absent" - name: "Add cargo to shell profile" ansible.builtin.blockinfile: - path: "{{ ansible_facts['env'].HOME }}/.bashrc" + path: "{{ ansible_facts['env']['HOME'] }}/.bashrc" state: "present" prepend_newline: true append_newline: true @@ -43,7 +43,7 @@ - name: "Install rust components" ansible.builtin.command: - cmd: "{{ ansible_facts['env'].HOME }}/.cargo/bin/rustup component add {{ item }}" + cmd: "{{ ansible_facts['env']['HOME'] }}/.cargo/bin/rustup component add {{ item }}" register: rust_component_result changed_when: "'is up to date' not in rust_component_result.stdout" loop: "{{ rust_components }}" |
