--- - name: "Check installed go versions" ansible.builtin.command: cmd: "mise ls go" register: go_installed_versions changed_when: false - name: "Install go versions" ansible.builtin.command: cmd: "mise use --global go@{{ item }}" changed_when: true when: item not in go_installed_versions.stdout loop: "{{ go_versions }}" - name: "Add Go bin to shell profile" ansible.builtin.blockinfile: path: "{{ ansible_facts['env']['HOME'] }}/.bashrc" state: "present" prepend_newline: true append_newline: true marker: "# ==== {mark} ANSIBLE GO CONFIG" block: | if [ -d "$HOME/go/bin" ]; then export PATH="$HOME/go/bin:$PATH" fi