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

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