Small refactoring; fish, zoxide, git, difftastic installation
This commit is contained in:
parent
cfce603631
commit
d3dac17247
1 changed files with 43 additions and 28 deletions
|
@ -1,33 +1,48 @@
|
|||
---
|
||||
- name: Install development tools
|
||||
hosts: localhost
|
||||
gather_facts: true
|
||||
tasks:
|
||||
- name: Install packages with homebrew
|
||||
community.general.homebrew:
|
||||
name:
|
||||
- hosts: all
|
||||
vars:
|
||||
common_packages:
|
||||
- neovim
|
||||
- ripgrep
|
||||
- fd
|
||||
- tree
|
||||
- gcc
|
||||
state: present
|
||||
when: ansible_facts['os_family'] == "Darwin"
|
||||
- fish
|
||||
- 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:
|
||||
name:
|
||||
- neovim
|
||||
- ripgrep
|
||||
- fd
|
||||
- tree
|
||||
- gcc
|
||||
name: "{{ packages }}"
|
||||
state: present
|
||||
become: true
|
||||
when: ansible_facts['os_family'] == "Archlinux"
|
||||
|
||||
- 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
|
||||
when: is_arch
|
||||
|
|
Loading…
Reference in a new issue