- name: Install pip package become: "{{ do_become }}" ansible.builtin.apt: name: python3-pip - name: Install github package become: "{{ do_become }}" ansible.builtin.pip: name: github3.py - 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 bash --config https://gist.github.com/Roxedus/6a11a5dbd37c24ecacf02fb9aef06e15/raw)" create: yes - name: Basic VI ansible.builtin.lineinfile: mode: "0644" path: /home/{{ users.0.username }}/.vimrc line: set nocompatible create: yes