Small refactoring; fish, zoxide, git, difftastic installation

This commit is contained in:
Ivan Golikov 2024-12-15 12:15:03 +01:00
parent cfce603631
commit d3dac17247

View file

@ -1,33 +1,48 @@
--- ---
- name: Install development tools - hosts: all
hosts: localhost vars:
gather_facts: true common_packages:
tasks:
- name: Install packages with homebrew
community.general.homebrew:
name:
- neovim - neovim
- ripgrep - ripgrep
- fd - fd
- tree - tree
- gcc - gcc
state: present - fish
when: ansible_facts['os_family'] == "Darwin" - zoxide
- git
- difftastic
- name: Install packages with pacman brew_packages:
- pipx
pacman_packages:
- python-pipx
tasks:
- name: Check the current OS family
ansible.builtin.set_fact:
is_macos: "{{ ansible_facts['os_family'] == 'Darwin' }}"
is_arch: "{{ ansible_facts['os_family'] == 'Archlinux' }}"
- name: Get full packages list (macOS)
ansible.builtin.set_fact:
packages: "{{ common_packages + brew_packages }}"
when: is_macos
- name: Get full packages list (Manjaro)
ansible.builtin.set_fact:
packages: "{{ common_packages + pacman_packages }}"
when: is_arch
- name: Install packages (macOS)
community.general.homebrew:
name: "{{ packages }}"
state: present
when: is_macos
- name: Install packages (Manjaro)
community.general.pacman: community.general.pacman:
name: name: "{{ packages }}"
- neovim
- ripgrep
- fd
- tree
- gcc
state: present state: present
become: true become: true
when: ansible_facts['os_family'] == "Archlinux" when: is_arch
- name: Ensure dotfiles alias exists in .zshrc
ansible.builtin.lineinfile:
path: "{{ ansible_env.HOME }}/.zshrc"
line: "alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'"
create: yes