47 lines
1.5 KiB
YAML
47 lines
1.5 KiB
YAML
---
|
|
# Install Fisher plugin manager and configured plugins.
|
|
# Fisher bootstraps itself on first run — we just need the fish_plugins file.
|
|
|
|
- name: Ensure Fish config directory exists
|
|
ansible.builtin.file:
|
|
path: "{{ cli_modern_user_home }}/.config/fish"
|
|
state: directory
|
|
owner: "{{ cli_modern_user }}"
|
|
group: "{{ cli_modern_user_group }}"
|
|
mode: "0755"
|
|
|
|
- name: Ensure Fish functions directory exists
|
|
ansible.builtin.file:
|
|
path: "{{ cli_modern_user_home }}/.config/fish/functions"
|
|
state: directory
|
|
owner: "{{ cli_modern_user }}"
|
|
group: "{{ cli_modern_user_group }}"
|
|
mode: "0755"
|
|
|
|
- name: Download Fisher
|
|
ansible.builtin.get_url:
|
|
url: https://raw.githubusercontent.com/jorgebucaran/fisher/main/functions/fisher.fish
|
|
dest: "{{ cli_modern_user_home }}/.config/fish/functions/fisher.fish"
|
|
owner: "{{ cli_modern_user }}"
|
|
group: "{{ cli_modern_user_group }}"
|
|
mode: "0644"
|
|
|
|
- name: Deploy fish_plugins list
|
|
ansible.builtin.template:
|
|
src: fish_plugins.j2
|
|
dest: "{{ cli_modern_user_home }}/.config/fish/fish_plugins"
|
|
owner: "{{ cli_modern_user }}"
|
|
group: "{{ cli_modern_user_group }}"
|
|
mode: "0644"
|
|
|
|
- name: Install Fisher plugins
|
|
become: true
|
|
become_user: "{{ cli_modern_user }}"
|
|
ansible.builtin.command: >
|
|
fish -c "fisher update"
|
|
args:
|
|
chdir: "{{ cli_modern_user_home }}"
|
|
register: cli_modern_fisher_install
|
|
changed_when: "'Installing' in cli_modern_fisher_install.stdout or 'Updating' in cli_modern_fisher_install.stdout"
|
|
failed_when: false
|