ansible-docker-mailcow/roles/install_oh-my-zsh/tasks/starship.yml
Jesko Anschütz d563801458 initial
2025-03-20 10:39:09 +01:00

40 lines
1.1 KiB
YAML

---
# tasks file for starship
- name: Install starship (cross-shell prompt) as a package
become: true
ansible.builtin.package:
state: present
name: starship
when: ansible_os_family == 'Archlinux'
- name: Install curl (for starship installation)
become: true
ansible.builtin.package:
state: present
name: curl
when: ansible_os_family != 'Archlinux'
- name: Get starship install script
ansible.builtin.get_url:
url: https://starship.rs/install.sh
dest: /tmp/starship_install.sh
mode: '0755'
register: starship_installation_script
when: ansible_os_family != 'Archlinux'
- name: Install starship with installation script
become: true
ansible.builtin.shell:
cmd: /tmp/starship_install.sh --yes
executable: /bin/sh
when: ansible_os_family != 'Archlinux' and starship_installation_script.changed
# if the previous task hasn't changed, the shell script is already there
# and we have already installed starship
# we check this to satisfy idempotence
- name: Copy zshrc (for starship)
ansible.builtin.copy:
src: zshrc-starship
dest: ~/.zshrc
mode: 0644
when: copy_dot_files