Infra/ansible/tasks/omp.yml

52 lines
1.4 KiB
YAML
Raw Normal View History

2022-10-18 22:20:04 +02:00
- name: Install pip package
become: true
ansible.builtin.apt:
name: python3-pip
- name: Install github package
become: true
ansible.builtin.pip:
name: github3.py
2022-04-15 15:51:58 +02:00
- 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
2022-10-18 22:20:04 +02:00
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
2022-04-15 15:51:58 +02:00
create: yes