- name: Check if OMP is installed ansible.builtin.stat: path: /opt/scripts/oh-my-posh register: omp_bin - name: Check OMP version when: omp_bin.stat.exists ansible.builtin.command: /opt/scripts/oh-my-posh -version register: omp_ver - name: Get latest release of OMP community.general.github_release: user: JanDeDobbeleer repo: oh-my-posh action: latest_release register: omp_latest - name: Download OMP when: not omp_bin.stat.exists or omp_latest != ( "v" + omp_ver ) become: "{{ do_become }}" ansible.builtin.get_url: url: https://github.com/JanDeDobbeleer/oh-my-posh/releases/download/{{ omp_latest.tag }}/posh-linux-{{ apt_arch }} dest: /usr/local/bin/oh-my-posh mode: "0744" owner: "{{ users.0.username }}" group: "{{ users.0.groupname }}" force: "yes" - name: Add OMP to bash ansible.builtin.lineinfile: mode: "0644" path: /home/{{ users.0.username }}/.bashrc line: eval "$(oh-my-posh --init --shell bash --config https://gist.githubusercontent.com/Roxedus/6a11a5dbd37c24ecacf02fb9aef06e15/raw/bd0955596238ab4e31db64c0ab1551c0ee375619/oh-my.posh.json)" create: yes