Files
ansible-playbooks/roles/zsh/tasks/plugins.yml
T

65 lines
2.0 KiB
YAML

---
- name: Ensure plugins directory exists
ansible.builtin.file:
path: "{{ zsh_plugins_path }}"
state: directory
owner: "{{ zsh_plugins_owner }}"
group: "{{ zsh_plugins_group }}"
mode: "0755"
- name: Add a readme file to advice from where this comes
ansible.builtin.copy:
dest: "{{ zsh_plugins_path }}/README.md"
content: |
# zsh plugins
Managed by Ansible
mode: "0644"
group: "{{ zsh_plugins_group }}"
owner: "{{ zsh_plugins_owner }}"
- name: "Git clone plugins"
ansible.builtin.git:
repo: "{{ item.repo }}"
dest: "{{ item.dest }}"
update: true
version: "{{ item.version | default('master') }}"
loop:
- repo: https://github.com/zsh-users/zsh-syntax-highlighting.git
dest: "{{ zsh_plugins_path }}/zsh-syntax-highlighting"
- repo: https://github.com/zsh-users/zsh-autosuggestions.git
dest: "{{ zsh_plugins_path }}/zsh-autosuggestions"
- repo: https://github.com/romkatv/powerlevel10k.git
dest: "{{ zsh_plugins_path }}/powerlevel10k"
- repo: https://github.com/zsh-users/zsh-history-substring-search.git
dest: "{{ zsh_plugins_path }}/zsh-history-substring-search"
- repo: https://github.com/Aloxaf/fzf-tab.git
dest: "{{ zsh_plugins_path }}/fzf-tab"
version: master
- name: Install fzf package (Linux)
ansible.builtin.package:
name: fzf
state: present
when: not (zsh_os_darwin | bool)
- name: Install fzf package (macOS)
community.general.homebrew:
name: fzf
state: present
become: false
when: zsh_os_darwin | bool
- name: Assert plugins are available for any user
ansible.builtin.file:
path: "{{ item }}"
owner: "{{ zsh_plugins_owner }}"
group: "{{ zsh_plugins_group }}"
mode: "0755"
state: directory
loop:
- "{{ zsh_plugins_path }}/zsh-syntax-highlighting"
- "{{ zsh_plugins_path }}/zsh-autosuggestions"
- "{{ zsh_plugins_path }}/powerlevel10k"
- "{{ zsh_plugins_path }}/zsh-history-substring-search"
- "{{ zsh_plugins_path }}/fzf-tab"