Sostituzione di prepare con un playbook che viene lanciato sulla macchina locale.

This commit is contained in:
Emiliano Vavassori 2024-10-01 00:19:21 +02:00
parent 23343af106
commit 813cf57d54
78 changed files with 885 additions and 70 deletions

4
ansible.cfg Normal file
View File

@ -0,0 +1,4 @@
[defaults]
inventory = hosts
host_key_checking=False
roles = roles

6
deploy.yml Normal file
View File

@ -0,0 +1,6 @@
---
- hosts: all
roles:
- dotfiles
become: yes
become_user: root

1
hosts Normal file
View File

@ -0,0 +1 @@
localhost ansible_connection=local

View File

@ -1,70 +0,0 @@
#!/bin/sh
# copying all the needed stuff in place.
DOTFILES=${HOME}/.dotfiles
# copying zshrc file
if [[ ! -f "$HOME/.zshrc" ]]; then
# no first setup done
# Determining operating system so we can quickly setup basic configuration
if grep -qi 'debian' /proc/version; then
# Debian
sudo apt install -y zsh-autosuggestions zsh-syntax-highlighting
ln -sf ${DOTFILES}/zsh/distro/debian.base.zsh ${DOTFILES}/zsh/distro.base.zsh
fi
if grep -qi 'ubuntu' /proc/version; then
# TODO: complete instructions for Ubuntu
ln -sf ${DOTFILES}/zsh/distro/ubuntu.base.zsh ${DOTFILES}/zsh/distro.base.zsh
fi
if grep -qi 'manjaro' /proc/version; then
# TODO: complete instructions for Manjaro
pamac install manjaro-zsh-config
ln -sf ${DOTFILES}/zsh/distro/manjaro.base.zsh ${DOTFILES}/zsh/distro.base.zsh
fi
if grep -qi 'archlinux' /proc/version; then
pacman -S zsh-autosuggestions zsh-syntax-highlighting
ln -sf ${DOTFILES}/zsh/distro/archlinux.base.zsh ${DOTFILES}/zsh/distro.base.zsh
fi
if grep -qi 'voidlinux' /proc/version; then
xbps-install -S zsh
ln -sf ${DOTFILES}/zsh/distro/void.base.zsh ${DOTFILES}/zsh/distro.base.zsh
fi
if [[ -f /etc/redhat-release ]] && grep -qi centos /etc/redhat-release; then
# TODO: installation on centos.
ln -sf ${DOTFILES}/zsh/distro/centos.base.zsh ${DOTFILES}/zsh/distro.base.zsh
fi
cp "${DOTFILES}/zshrc" "$HOME/.zshrc"
if [[ -f ${DOTFILES}/zsh/antibody_plugins.txt ]]; then
# Installing natively on archlinux, manjaro
if grep -i archlinux /proc/version || grep -i manjaro /proc/version; then
yay -S --no-confirm zsh-antidote
else
git clone --depth=1 https://github.com/mattmc3/antidote.git ${ZDOTDIR:-$HOME}/.antidote
fi
mkdir -p ~/.zsh/conf.d
source /usr/share/zsh-antidote/antidote.zsh
antidote bundle < ${DOTFILES}/zsh/antibody_plugins.txt > ~/.zsh/conf.d/000_antidote.zsh
fi
# Copying tmux configuration file and initialize plugins.
if [[ ! -f "$HOME/.tmux.conf" ]]; then
mkdir -p ${HOME}/.config/tmux/plugins
git clone https://github.com/tmux-plugins/tpm ${HOME}/.config/tmux/plugins/tpm
ln -sf "${DOTFILES}/tmux.conf" "$HOME/.config/tmux/tmux.conf"
echo "Please, open Tmux and run 'prefix I'."
fi
# Vim - configure vundle and install plugins.
if [[ ! -f "${HOME}/.vimrc" ]]; then
ln -sf ${DOTFILES}/vimrc ${HOME}/.vimrc
ln -sf ${DOTFILES}/vim ${HOME}/.vim
# Installing vim-plug
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
# Installing vim-plug and relative plugins
vim +PlugInstall +qall
fi

View File

@ -0,0 +1,2 @@
---
dotfdir: "{{ lookup('ansible.builtin.env', 'HOME' ) }}/.dotfiles"

View File

@ -0,0 +1,17 @@
---
# Configuring zsh bundles
- name: Assuring the conf.d folder exists
ansible.builtin.file:
dest: "{{ lookup('ansible.builtin.env', 'HOME' ) }}/.zsh/conf.d"
state: directory
owner: syntaxerrormmm
group: syntaxerrormmm
mode: '0755'
- name: Building lazy-loading list
ansible.builtin.shell: >-
source ~/.zsh/antidote/antidote.zsh;
antidote bundle < {{ dotfdir }}/zsh/antibody_plugins.txt > ~/.zsh/conf.d/000_antidote.zsh
args:
executable: /usr/bin/zsh

View File

@ -0,0 +1,16 @@
---
# Installing antidote.
- name: Creating destination folder
ansible.builtin.file:
dest: "{{ lookup('ansible.builtin.env', 'HOME' ) }}/.zsh/antidote"
state: directory
owner: syntaxerrormmm
group: syntaxerrormmm
mode: "0755"
- name: Installing antidote with git
ansible.builtin.git:
repo: "https://github.com/mattmc3/antidote.git"
dest: "{{ lookup('ansible.builtin.env','HOME' ) }}/.zsh/antidote"
depth: 1

View File

@ -0,0 +1,14 @@
---
# Deploying antidote
- name: Installing antidote
ansible.builtin.import_tasks: installation.yml
tags:
- antidote
- antidote-install
- name: Configuring antidote
ansible.builtin.import_tasks: configuration.yml
tags:
- antidote
- antidote-config

View File

@ -0,0 +1,12 @@
---
dependencies:
- git
- fzf
- pip
- rsync
- rclone
- zsh
- antidote
- tmux
- vim
- vim-plug

View File

@ -0,0 +1,9 @@
---
# FZF on alpine
- name: (alp) FZF installation
community.general.apk:
name: fzf
state: present
update_cache: true
become: true

View File

@ -0,0 +1,9 @@
---
# FZF on Arch
- name: (arch) FZF install
community.general.pacman:
name: fzf
state: present
update_cache: true
become: true

View File

@ -0,0 +1,9 @@
---
# FZF on Debian
- name: (deb) FZF install
ansible.builtin.apt:
name: fzf
state: present
update_cache: true
become: true

View File

@ -0,0 +1,21 @@
---
# FZF on RedHat
# reverting to installation from git repo
- name: (rHa) FZF - Build directory
ansible.builtin.file:
dest: "{{ lookup('ansible.builtin.env', 'HOME' ) }}/.fzf"
state: directory
owner: syntaxerrormmm
group: syntaxerrormmm
mode: '0755'
- name: (rHa) FZF - clone from git
ansible.builtin.git:
repo: https://github.com/junegunn/fzf.git
depth: 1
dest: "{{ lookup('ansible.builtin.env', 'HOME' ) }}/.fzf"
- name: (rHa) FZF - Installing
ansible.builtin.command: >-
{{ lookup('ansible.builtin.env', 'HOME' ) }}/.fzf/install

View File

@ -0,0 +1,9 @@
---
# FZF - install on Void
- name: (void) FZF - install
community.general.xbps:
name: fzf
state: present
update_cache: true
become: true

13
roles/fzf/tasks/main.yml Normal file
View File

@ -0,0 +1,13 @@
---
# Installation of fzf
- name: Installation
ansible.builtin.include_tasks: "install/{{ ansible_os_family | lower }}.yml"
args:
apply:
tags:
- fzf
- fzf-install
tags:
- fzf
- fzf-install

View File

@ -0,0 +1,14 @@
---
# Configuring git
- name: Configuring git username
ansible.builtin.git_config:
name: user.name
scope: global
value: "Emiliano Vavassori"
- name: Configuring git email
ansible.builtin.git_config:
name: user.email
scope: global
value: syntaxerrormmm@gmail.com

View File

@ -0,0 +1,9 @@
---
# git on alpine
- name: (alp) installing git
community.general.apk:
name: git
state: present
update_cache: true
become: true

View File

@ -0,0 +1,9 @@
---
# git on Archlinux
- name: (arch) installing git
community.general.pacman:
name: git
state: present
update_cache: true
become: true

View File

@ -0,0 +1,9 @@
---
# git on Debian
- name: (deb) installing git
ansible.builtin.apt:
name: git
state: present
update_cache: true
become: true

View File

@ -0,0 +1,9 @@
---
# git on RedHat
- name: (rHa) installing git
ansible.builtin.yum:
name: git
state: present
update_cache: true
become: true

View File

@ -0,0 +1,9 @@
---
# git on void
- name: (void) installing git
community.general.xbps:
name: git
state: present
update_cache: true
become: true

19
roles/git/tasks/main.yml Normal file
View File

@ -0,0 +1,19 @@
---
# Installing and configuring git
- name: Installation
ansible.builtin.include_tasks: "install/{{ ansible_os_family | lower }}.yml"
args:
apply:
tags:
- git
- git-install
tags:
- git
- git-install
- name: Configuring git
ansible.builtin.import_tasks: configuration.yml
tags:
- git
- git-config

View File

@ -0,0 +1,11 @@
---
# pip on alpine
- name: (alp) installing pip
community.general.apk:
name:
- py3-pip
- py3-virtualenv
state: present
update_cache: true
become: true

View File

@ -0,0 +1,11 @@
---
# pip on Archlinux
- name: (arch) installing pip
community.general.pacman:
name:
- python-pip
- python-virtualenv
state: present
update_cache: true
become: true

View File

@ -0,0 +1,11 @@
---
# Pip on debian
- name: (deb) installing pip
ansible.builtin.apt:
name:
- python3-pip
- python3-virtualenv
state: present
update_cache: true
become: true

View File

@ -0,0 +1,11 @@
---
# pip on redhat
- name: (rHa) installing pip
ansible.builtin.yum:
name:
- python3-pip
- python-virtualenv
state: present
update_cache: true
become: true

View File

@ -0,0 +1,11 @@
---
# pip on void
- name: (void) installing pip
community.general.xbps:
name:
- python-pip
- python3-virtualenv
state: present
update_cache: true
become: true

13
roles/pip/tasks/main.yml Normal file
View File

@ -0,0 +1,13 @@
---
# Verifying pip is installed.
- name: Installing pip
ansible.builtin.include_tasks: "install/{{ ansible_os_family | lower }}.yml"
args:
apply:
tags:
- pip
- pip-install
tags:
- pip
- pip-install

View File

@ -0,0 +1,7 @@
---
- name: (alp) installing rclone
community.general.apk:
name: rclone
state: present
update_cache: true
become: true

View File

@ -0,0 +1,7 @@
---
- name: (arch) installing rclone
community.general.pacman:
name: rclone
state: present
update_cache: true
become: true

View File

@ -0,0 +1,7 @@
---
- name: (deb) installing rclone
ansible.builtin.apt:
name: rclone
state: present
update_cache: true
become: true

View File

@ -0,0 +1,7 @@
---
- name: (rHa) installing rclone
ansible.builtin.yum:
name: rclone
state: present
update_cache: true
become: true

View File

@ -0,0 +1,7 @@
---
- name: (void) installing rclone
community.general.xbps:
name: rclone
state: present
update_cache: true
become: true

View File

@ -0,0 +1,13 @@
---
# Rclone
- name: Installation
ansible.builtin.include_tasks: "install/{{ ansible_os_family | lower }}.yml"
args:
apply:
tags:
- rclone
- rclone-install
tags:
- rclone
- rclone-install

View File

@ -0,0 +1,9 @@
---
# rsync
- name: (alp) installing rsync
community.general.apk:
name: rsync
state: present
update_cache: true
become: true

View File

@ -0,0 +1,7 @@
---
- name: (arch) installing rsync
community.general.pacman:
name: rsync
state: present
update_cache: true
become: true

View File

@ -0,0 +1,7 @@
---
- name: (deb) installing rsync
ansible.builtin.apt:
name: rsync
state: present
update_cache: true
become: true

View File

@ -0,0 +1,7 @@
---
- name: (rHa) installing rsync
ansible.builtin.yum:
name: rsync
state: present
update_cache: true
become: true

View File

@ -0,0 +1,7 @@
---
- name: (void) installing rsync
community.general.xbps:
name: rsync
state: present
update_cache: true
become: true

View File

@ -0,0 +1,13 @@
---
# Rsync
- name: Installation
ansible.builtin.include_tasks: "install/{{ ansible_os_family | lower }}.yml"
args:
apply:
tags:
- rsync
- rsync-install
tags:
- rsync
- rsync-install

View File

@ -0,0 +1,2 @@
---
dotfdir: "{{ lookup('ansible.builtin.env', 'HOME' ) }}/.dotfiles"

View File

@ -0,0 +1,32 @@
---
# Tmux standard configuration
- name: Creating configuration folders
ansible.builtin.file:
path: "{{ lookup('ansible.builtin.env', 'HOME' ) }}/.config/tmux/plugins"
state: directory
owner: syntaxerrormmm
group: syntaxerrormmm
mode: '0755'
- name: Getting tpm
ansible.builtin.git:
repo: https://github.com/tmux-plugins/tpm.git
depth: 1
dest: "{{ lookup('ansible.builtin.env', 'HOME' ) }}/.config/tmux/plugins/tpm"
- name: Linking default configuration file
ansible.builtin.file:
src: "{{ dotfdir }}/tmux.conf"
dest: "{{ lookup('ansible.builtin.env', 'HOME' ) }}/.config/tmux/tmux.conf"
state: link
owner: syntaxerrormmm
group: syntaxerrormmm
- name: Fallback default old standard
ansible.builtin.file:
src: "{{ lookup('ansible.builtin.env', 'HOME' ) }}/.config/tmux/tmux.conf"
dest: "{{ lookup('ansible.builtin.env', 'HOME' ) }}/.tmux.conf"
state: link
owner: syntaxerrormmm
group: syntaxerrormmm

View File

@ -0,0 +1,7 @@
---
- name: (alp) installing tmux
community.general.apk:
name: tmux
state: present
update_cache: true
become: true

View File

@ -0,0 +1,7 @@
---
- name: (arch) installing tmux
community.general.pacman:
name: tmux
state: present
update_cache: true
become: true

View File

@ -0,0 +1,7 @@
---
- name: (deb) installing tmux
ansible.builtin.apt:
name: tmux
state: present
update_cache: true
become: true

View File

@ -0,0 +1,7 @@
---
- name: (rHa) installing tmux
ansible.builtin.yum:
name: tmux
state: present
update_cache: true
become: true

View File

@ -0,0 +1,7 @@
---
- name: (void) installing tmux
community.general.xbps:
name: tmux
state: present
update_cache: true
become: true

23
roles/tmux/tasks/main.yml Normal file
View File

@ -0,0 +1,23 @@
---
# Managing tmux
- name: Installation
ansible.builtin.include_tasks: "install/{{ ansible_os_family | lower }}.yml"
args:
apply:
tags:
- tmux
- tmux-install
tags:
- tmux
- tmux-install
- name: Configuration
ansible.builtin.import_tasks: configuration.yml
tags:
- tmux
- tmux-config
- name: Manual steps
ansible.builtin.debug:
msg: "Please run prefix + I in tmux to install the needed plugins."

View File

@ -0,0 +1,5 @@
---
- name: repolist
ansible.builtin.command: yum repolist
become: true
become_user: root

View File

@ -0,0 +1,10 @@
---
- name: (alp) installing plugin dependencies
community.general.apk:
name:
- nodejs
- npm
- yarn
state: present
update_cache: true
become: true

View File

@ -0,0 +1,10 @@
---
- name: (arch) installing plugin dependencies
community.general.pacman:
name:
- nodejs
- npm
- yarn
state: present
update_cache: true
become: true

View File

@ -0,0 +1,10 @@
---
- name: (deb) installing plugin dependencies
ansible.builtin.apt:
name:
- nodejs
- npm
- yarnpkg
state: present
update_cache: true
become: true

View File

@ -0,0 +1,34 @@
---
- name: (rHa) installing plugin dependencies
ansible.builtin.yum:
name:
- nodejs
- npm
state: present
update_cache: true
become: true
# Yarn is available in other repository.
- name: (rHa) installing yarn repo
ansible.builtin.get_url:
url: "https://dl.yarnpkg.com/rpm/yarn.repo"
dest: /etc/yum.repos.d/yarn.repo
become: true
notify: repolist
- name: (rHa) installing yarn gpg key
ansible.builtin.rpm_key:
key: "http://dl.yarnpkg.com/rpm/pubkey.gpg"
state: present
become: true
notify: repolist
- name: Flushing handlers
ansible.builtin.meta: flush_handlers
- name: (rHa) installing yarn
ansible.builtin.yum:
name: yarn
state: present
update_cache: true
become: true

View File

@ -0,0 +1,9 @@
---
- name: (void) installing plugin dependencies
community.general.xbps:
name:
- nodejs
- yarn-bin
state: present
update_cache: true
become: true

View File

@ -0,0 +1,20 @@
---
# Installation tasks
- name: Installing plugin dependencies
ansible.builtin.include_tasks: "depend/{{ ansible_os_family | lower }}.yml"
- name: Creating autoload dir
ansible.builtin.file:
path: "{{ lookup('ansible.builtin.env', 'HOME' ) }}/.vim/autoload"
state: directory
owner: syntaxerrormmm
group: syntaxerrormmm
- name: Installing vim-plug from git
ansible.builtin.get_url:
url: "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim"
dest: "{{ lookup('ansible.builtin.env', 'HOME' ) }}/.vim/autoload/plug.vim"
owner: syntaxerrormmm
group: syntaxerrormmm
mode: '0644'

View File

@ -0,0 +1,12 @@
---
# Configuring vim-plug
- name: Installation
ansible.builtin.import_tasks: installation.yml
tags:
- vim-plug
- vim-plug-install
- name: Configuration
ansible.builtin.shell: >-
vim +PlugInstall +qall

View File

@ -0,0 +1,2 @@
---
dotfdir: "{{ lookup('ansible.builtin.env', 'HOME' ) }}/.dotfiles"

View File

@ -0,0 +1,18 @@
---
# Configuring vim
- name: Linking main file
ansible.builtin.file:
src: "{{ dotfdir }}/vimrc"
dest: "{{ lookup('ansible.builtin.env', 'HOME' ) }}/.vimrc"
state: link
owner: syntaxerrormmm
group: syntaxerrormmm
- name: Linking main folder
ansible.builtin.file:
src: "{{ dotfdir }}/vim"
dest: "{{ lookup('ansible.builtin.env', 'HOME' ) }}/.vim"
state: link
owner: syntaxerrormmm
group: syntaxerrormmm

View File

@ -0,0 +1,7 @@
---
- name: (alp) installing vim
community.general.apk:
name: vim
state: present
update_cache: true
become: true

View File

@ -0,0 +1,7 @@
---
- name: (arch) installing vim
community.general.pacman:
name: vim
state: present
update_cache: true
become: true

View File

@ -0,0 +1,7 @@
---
- name: (deb) installing vim
ansible.builtin.apt:
name: vim
state: present
update_cache: true
become: true

View File

@ -0,0 +1,7 @@
---
- name: (rHa) installing vim
ansible.builtin.yum:
name: vim
state: present
update_cache: true
become: true

View File

@ -0,0 +1,7 @@
---
- name: (void) installing Vim
community.general.xbps:
name: vim
state: present
update_cache: true
become: true

19
roles/vim/tasks/main.yml Normal file
View File

@ -0,0 +1,19 @@
---
# Vim
- name: Installation
ansible.builtin.include_tasks: "install/{{ ansible_os_family | lower }}.yml"
args:
apply:
tags:
- vim
- vim-install
tags:
- vim
- vim-install
- name: Configuration
ansible.builtin.import_tasks: configuration.yml
tags:
- vim
- vim-config

View File

@ -0,0 +1,2 @@
---
dotfdir: "{{ lookup('ansible.builtin.env', 'HOME' }}/.dotfiles"

View File

@ -0,0 +1,10 @@
---
# Configuration for base settings - Alpine
- name: (alp) - ZSH base configuration
ansible.builtin.file:
src: "{{ dotfdir }}/zsh/distro/alpine.base.zsh"
dest: "{{ dotfdir }}/zsh/distro.base.zsh"
state: link
owner: syntaxerrormmm
group: syntaxerrormmm

View File

@ -0,0 +1,20 @@
---
# Configuration for base settings - Archlinux
- name: (arch) - ZSH base configuration
ansible.builtin.file:
src: "{{ dotfdir }}/zsh/distro/archlinux.base.zsh"
dest: "{{ dotfdir }}/zsh/distro.base.zsh"
state: link
owner: syntaxerrormmm
group: syntaxerrormmm
when: ansible_lsb == [] or ansible_lsb.description == 'Arch Linux'
- name: (manj) - ZSH base configuration
ansible.builtin.file:
src: "{{ dotfdir }}/zsh/distro/manjaro.base.zsh"
dest: "{{ dotfdir }}/zsh/distro.base.zsh"
state: link
owner: syntaxerrormmm
group: syntaxerrormmm
when: ansible_lsb != [] and ansible_lsb.description == 'Manjaro Linux'

View File

@ -0,0 +1,20 @@
---
# Configuration for base settings - Debian
- name: (deb) - ZSH base configuration
ansible.builtin.file:
src: "{{ dotfdir }}/zsh/distro/debian.base.zsh"
dest: "{{ dotfdir }}/zsh/distro.base.zsh"
state: link
owner: syntaxerrormmm
group: syntaxerrormmm
when: ansible_distribution == 'Debian'
- name: (ubu) - ZSH base configuration
ansible.builtin.file:
src: "{{ dotfdir }}/zsh/distro/ubuntu.base.zsh"
dest: "{{ dotfdir }}/zsh/distro.base.zsh"
state: link
owner: syntaxerrormmm
group: syntaxerrormmm
when: ansible_distribution == 'Ubuntu'

View File

@ -0,0 +1,26 @@
---
# Configuring zsh
- name: Fixing base settings
ansible.builtin.include_tasks: "{{ ansible_os_family | lower }}.yml"
- name: Set zsh as default shell for syntaxerrormmm
ansible.builtin.user:
name: syntaxerrormmm
shell: /usr/bin/zsh
- name: Creating personal folder for customization
ansible.builtin.file:
path: "{{ lookup('ansible.builtin.env', 'HOME' ) }}/.zsh/conf.d"
state: directory
owner: syntaxerrormmm
group: syntaxerrormmm
mode: "0755"
- name: Linking main file
ansible.builtin.file:
src: "{{ dotfdir }}/zshrc"
dest: "{{ lookup('ansible.builtin.env', 'HOME' ) }}/.zshrc"
state: link
owner: syntaxerrormmm
group: syntaxerrormmm

View File

@ -0,0 +1,10 @@
---
# Configuration for base settings - RedHat
- name: (rha) - ZSH base configuration
ansible.builtin.file:
src: "{{ dotfdir }}/zsh/distro/centos.base.zsh"
dest: "{{ dotfdir }}/zsh/distro.base.zsh"
state: link
owner: syntaxerrormmm
group: syntaxerrormmm

View File

@ -0,0 +1,10 @@
---
# Configuration for base settings - Void
- name: (void) - ZSH base configuration
ansible.builtin.file:
src: "{{ dotfdir }}/zsh/distro/void.base.zsh"
dest: "{{ dotfdir }}/zsh/distro.base.zsh"
state: link
owner: syntaxerrormmm
group: syntaxerrormmm

View File

@ -0,0 +1,31 @@
---
# Configuring zsh
- name: Set zsh as default shell for syntaxerrormmm
ansible.builtin.user:
name: syntaxerrormmm
shell: /usr/bin/zsh
tags:
- zsh
- omz
- zsh-config
- zsh-config-omz
- name: Creating personal folder for customization
ansible.builtin.file:
path: "{{ lookup('ansible.builtin.env', 'HOME' ) }}/.zsh/conf.d"
state: directory
owner: syntaxerrormmm
group: syntaxerrormmm
mode: "0755"
- name: Linking main file
ansible.builtin.file:
src: "{{ dotfdir }}/zshrc"
dest: "{{ lookup('ansible.builtin.env', 'HOME' ) }}/.zshrc"
state: link
owner: syntaxerrormmm
group: syntaxerrormmm
- name: Fixing base settings
ansible.builtin.include_tasks: "{{ ansible_os_family | lower }}.yml"

View File

@ -0,0 +1,14 @@
---
- name: (Alpine) Installing packages around zsh
community.general.apk:
name:
- zsh
- zsh-completions
- zsh-autosuggestions
- zsh-syntax-highlighting
- zsh-history-substring-search
- zsh-theme-powerlevel10k
- zsh-vcs
state: present
update_cache: true
become: true

View File

@ -0,0 +1,13 @@
---
- name: (Arch) Installing packages around zsh
community.general.pacman:
name:
- zsh
- zsh-completions
- zsh-autosuggestions
- zsh-syntax-highlighting
- zsh-history-substring-search
- zsh-theme-powerlevel10k
state: present
update_cache: true
become: true

View File

@ -0,0 +1,25 @@
---
# Installing zsh and its dependency
- name: (Deb) Installing packages around zsh
ansible.builtin.apt:
name:
- zsh
- zsh-autosuggestions
- zsh-syntax-highlighting
state: present
update_cache: true
when: ansible_distribution == 'Debian'
become: true
- name: (ubu) Installing packages around zsh
ansible.builtin.apt:
name:
- zsh
- zsh-autosuggestions
- zsh-syntax-highlighting
- zsh-theme-powerlevel9k
state: present
update_cache: true
when: ansible_distribution == 'Ubuntu'
become: true

View File

@ -0,0 +1,9 @@
---
- name: (RH) Installing packages around zsh
ansible.builtin.yum:
name:
- zsh
- zsh-syntax-highlighting
state: present
update_cache: true
become: true

View File

@ -0,0 +1,14 @@
---
# Installing zsh and its dependency
- name: (Void) Installing packages around zsh
community.general.xbps:
name:
- zsh
- zsh-completions
- zsh-autosuggestions
- zsh-syntax-highlighting
- zsh-history-substring-search
state: present
update_cache: true
become: true

19
roles/zsh/tasks/main.yml Normal file
View File

@ -0,0 +1,19 @@
---
# Setting up zsh
- name: Installation
ansible.builtin.include_tasks: "install/{{ ansible_os_family | lower }}.yml"
args:
apply:
tags:
- zsh
- zsh-install
tags:
- zsh
- zsh-install
- name: Configuration
ansible.builtin.import_tasks: config/main.yml
tags:
- zsh
- zsh-config