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: all
|
||||||
hosts: localhost
|
vars:
|
||||||
gather_facts: true
|
common_packages:
|
||||||
tasks:
|
- neovim
|
||||||
- name: Install packages with homebrew
|
- ripgrep
|
||||||
community.general.homebrew:
|
- fd
|
||||||
name:
|
- tree
|
||||||
- neovim
|
- gcc
|
||||||
- ripgrep
|
- fish
|
||||||
- fd
|
- zoxide
|
||||||
- tree
|
- git
|
||||||
- gcc
|
- difftastic
|
||||||
state: present
|
|
||||||
when: ansible_facts['os_family'] == "Darwin"
|
|
||||||
|
|
||||||
- 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
|
|
||||||
|
|
Loading…
Reference in a new issue