mirror of
https://github.com/Crocmagnon/ansible.git
synced 2025-04-11 03:26:22 +02:00
Compare commits
4 commits
fef296cbbd
...
7d3c9dcad4
Author | SHA1 | Date | |
---|---|---|---|
7d3c9dcad4 | |||
44f4fd1c4c | |||
e599994186 | |||
520fda6daa |
3 changed files with 44 additions and 1 deletions
playbooks/dependencies
|
@ -11,7 +11,8 @@
|
||||||
- name: Setup venv
|
- name: Setup venv
|
||||||
# github3.py required by the goatcounter playbook
|
# github3.py required by the goatcounter playbook
|
||||||
ansible.builtin.shell: |
|
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
|
/usr/bin/python3 -m venv /tmp/ansible
|
||||||
/tmp/ansible/bin/pip install --upgrade 'github3.py >= 1.0.0a3'
|
/tmp/ansible/bin/pip install --upgrade 'github3.py >= 1.0.0a3'
|
||||||
args:
|
args:
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
---
|
---
|
||||||
# intentionally leaving 00-clean-deps to prevent re-creating the venv every time
|
# intentionally leaving 00-clean-deps to prevent re-creating the venv every time
|
||||||
- import_playbook: 01-setup-deps.yaml # noqa: name[play]
|
- import_playbook: 01-setup-deps.yaml # noqa: name[play]
|
||||||
|
- import_playbook: bat.yaml # noqa: name[play]
|
||||||
- import_playbook: caddy.yaml # noqa: name[play]
|
- import_playbook: caddy.yaml # noqa: name[play]
|
||||||
|
|
41
playbooks/dependencies/bat.yaml
Normal file
41
playbooks/dependencies/bat.yaml
Normal 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
|
Loading…
Add table
Reference in a new issue