- pi_hifiberry_amp: the boot config lives at /boot/firmware/config.txt. - pi_sysdweb: install python3-dbus and python3-systemd from apt, which trixie ships at the versions sysdweb needs; bookworm gets the headers pip needs to build dbus-python 1.4 itself. - pi_squeezeserver: trixie images have no iptables, and so cannot have the port 80 redirect that absent.yml removes - skip that step there instead of failing. - pi_modern_shell_env, pi_slint_frontend: read facts through `ansible_facts` rather than the deprecated injected `ansible_*` variables. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
84 lines
2.9 KiB
YAML
84 lines
2.9 KiB
YAML
---
|
|
- name: Install modern CLI packages
|
|
ansible.builtin.apt:
|
|
name: "{{ pi_modern_shell_env_packages }}"
|
|
state: present
|
|
update_cache: true
|
|
|
|
- name: Symlink fdfind to fd
|
|
ansible.builtin.file:
|
|
src: /usr/bin/fdfind
|
|
dest: /usr/local/bin/fd
|
|
state: link
|
|
|
|
- name: Symlink batcat to bat
|
|
ansible.builtin.file:
|
|
src: /usr/bin/batcat
|
|
dest: /usr/local/bin/bat
|
|
state: link
|
|
|
|
- name: Check whether oh-my-posh is already installed
|
|
ansible.builtin.stat:
|
|
path: /usr/local/bin/oh-my-posh
|
|
register: pi_modern_shell_env_ohmyposh
|
|
|
|
- name: Download oh-my-posh binary
|
|
# Only when missing. With the file present get_url still sends a conditional request
|
|
# every run, so a CDN that is slow or unreachable from the device (TLS handshake
|
|
# timeouts happen) failed the whole play for a prompt that was already installed.
|
|
# Delete the binary to pick up a newer release.
|
|
when: not pi_modern_shell_env_ohmyposh.stat.exists
|
|
ansible.builtin.get_url:
|
|
# The official install script's own curl-based downloads are blocked by
|
|
# oh-my-posh's CDN on some devices (observed on Raspberry Pi OS's curl
|
|
# build: TLS handshake fails with SSL_ERROR_SYSCALL), while Ansible's
|
|
# get_url (Python urllib) succeeds against the same CDN. Download the
|
|
# binary directly instead of shelling out to the install script.
|
|
url: "https://cdn.ohmyposh.dev/releases/latest/posh-linux-{{ pi_modern_shell_env_ohmyposh_arch_map[ansible_facts['architecture']] }}"
|
|
dest: /usr/local/bin/oh-my-posh
|
|
mode: "0755"
|
|
|
|
- name: Determine target user's home directory
|
|
ansible.builtin.set_fact:
|
|
pi_modern_shell_env_target_home: "{{ '/root' if pi_modern_shell_env_target_user == 'root' else '/home/' + pi_modern_shell_env_target_user }}"
|
|
|
|
- name: Ensure config directory exists
|
|
ansible.builtin.file:
|
|
path: "{{ pi_modern_shell_env_target_home }}/.config"
|
|
state: directory
|
|
owner: "{{ pi_modern_shell_env_target_user }}"
|
|
mode: "0700"
|
|
|
|
- name: Deploy oh-my-posh theme
|
|
ansible.builtin.copy:
|
|
src: ohmyposh.json
|
|
dest: "{{ pi_modern_shell_env_target_home }}/.config/ohmyposh.json"
|
|
owner: "{{ pi_modern_shell_env_target_user }}"
|
|
mode: "0644"
|
|
|
|
- name: Ensure fish config directory exists
|
|
ansible.builtin.file:
|
|
path: "{{ pi_modern_shell_env_target_home }}/.config/fish"
|
|
state: directory
|
|
owner: "{{ pi_modern_shell_env_target_user }}"
|
|
mode: "0700"
|
|
|
|
- name: Deploy fish config
|
|
ansible.builtin.template:
|
|
src: config.fish.j2
|
|
dest: "{{ pi_modern_shell_env_target_home }}/.config/fish/config.fish"
|
|
owner: "{{ pi_modern_shell_env_target_user }}"
|
|
mode: "0644"
|
|
|
|
- name: Ensure fish is a known login shell
|
|
ansible.builtin.lineinfile:
|
|
path: /etc/shells
|
|
line: /usr/bin/fish
|
|
state: present
|
|
|
|
- name: Set fish as the default login shell
|
|
ansible.builtin.user:
|
|
name: "{{ pi_modern_shell_env_target_user }}"
|
|
shell: /usr/bin/fish
|
|
when: pi_modern_shell_env_set_default_shell
|