Compare commits

...

4 commits

3 changed files with 44 additions and 1 deletions

View file

@ -11,7 +11,8 @@
- name: Setup venv
# github3.py required by the goatcounter playbook
ansible.builtin.shell: |
if [ -x /tmp/ansible/bin/python ]; then exit 123; fi
if [ -x /tmp/ansible/bin/python ] && [ -x /tmp/ansible/bin/pip ] ; then exit 123; fi
rm -rf /tmp/ansible
/usr/bin/python3 -m venv /tmp/ansible
/tmp/ansible/bin/pip install --upgrade 'github3.py >= 1.0.0a3'
args:

View file

@ -1,4 +1,5 @@
---
# intentionally leaving 00-clean-deps to prevent re-creating the venv every time
- import_playbook: 01-setup-deps.yaml # noqa: name[play]
- import_playbook: bat.yaml # noqa: name[play]
- import_playbook: caddy.yaml # noqa: name[play]

View file

@ -0,0 +1,41 @@
---
- name: Setup ansible python dependencies
hosts: servers
gather_facts: false
tasks:
- name: Install system deps
become: true
ansible.builtin.apt:
pkg:
- bat
- name: Link batcat to bat
ansible.builtin.file:
src: /usr/bin/batcat
dest: /home/gaugendre/.local/bin/bat
state: link
- name: Get bat config dir
ansible.builtin.command: /usr/bin/batcat --config-dir
register: confdir
changed_when: false
check_mode: false
- name: Create bat themes dir
ansible.builtin.file:
path: "{{ confdir.stdout }}/themes"
state: directory
mode: "0775"
- name: Download Catppuccin themes
ansible.builtin.get_url:
url: https://github.com/catppuccin/bat/raw/main/themes/Catppuccin%20{{ item }}.tmTheme
dest: "{{ confdir.stdout }}/themes/Catppuccin {{ item }}.tmTheme"
mode: "0664"
notify:
- Rebuild bat theme cache
loop:
- Latte
- Mocha
- Macchiato
- Frappe
handlers:
- name: Rebuild bat theme cache
ansible.builtin.command: /usr/bin/batcat cache --build
changed_when: true