diff --git a/ansible.cfg b/ansible.cfg new file mode 100644 index 0000000..68ac724 --- /dev/null +++ b/ansible.cfg @@ -0,0 +1,4 @@ +[defaults] +inventory = hosts +host_key_checking=False +roles = roles diff --git a/deploy.yml b/deploy.yml new file mode 100644 index 0000000..534146c --- /dev/null +++ b/deploy.yml @@ -0,0 +1,6 @@ +--- +- hosts: all + roles: + - dotfiles + become: yes + become_user: root diff --git a/hosts b/hosts new file mode 100644 index 0000000..2302eda --- /dev/null +++ b/hosts @@ -0,0 +1 @@ +localhost ansible_connection=local diff --git a/prepare.sh b/prepare.sh deleted file mode 100644 index 0be2b0c..0000000 --- a/prepare.sh +++ /dev/null @@ -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 diff --git a/roles/antidote/defaults/main.yml b/roles/antidote/defaults/main.yml new file mode 100644 index 0000000..acd7660 --- /dev/null +++ b/roles/antidote/defaults/main.yml @@ -0,0 +1,2 @@ +--- +dotfdir: "{{ lookup('ansible.builtin.env', 'HOME' ) }}/.dotfiles" diff --git a/roles/antidote/tasks/configuration.yml b/roles/antidote/tasks/configuration.yml new file mode 100644 index 0000000..91269f3 --- /dev/null +++ b/roles/antidote/tasks/configuration.yml @@ -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 diff --git a/roles/antidote/tasks/installation.yml b/roles/antidote/tasks/installation.yml new file mode 100644 index 0000000..49c5849 --- /dev/null +++ b/roles/antidote/tasks/installation.yml @@ -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 diff --git a/roles/antidote/tasks/main.yml b/roles/antidote/tasks/main.yml new file mode 100644 index 0000000..4f7f199 --- /dev/null +++ b/roles/antidote/tasks/main.yml @@ -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 diff --git a/roles/dotfiles/meta/main.yml b/roles/dotfiles/meta/main.yml new file mode 100644 index 0000000..874aef6 --- /dev/null +++ b/roles/dotfiles/meta/main.yml @@ -0,0 +1,12 @@ +--- +dependencies: + - git + - fzf + - pip + - rsync + - rclone + - zsh + - antidote + - tmux + - vim + - vim-plug diff --git a/roles/fzf/tasks/install/alpine.yml b/roles/fzf/tasks/install/alpine.yml new file mode 100644 index 0000000..da5d29d --- /dev/null +++ b/roles/fzf/tasks/install/alpine.yml @@ -0,0 +1,9 @@ +--- +# FZF on alpine + +- name: (alp) FZF installation + community.general.apk: + name: fzf + state: present + update_cache: true + become: true diff --git a/roles/fzf/tasks/install/archlinux.yml b/roles/fzf/tasks/install/archlinux.yml new file mode 100644 index 0000000..4400a01 --- /dev/null +++ b/roles/fzf/tasks/install/archlinux.yml @@ -0,0 +1,9 @@ +--- +# FZF on Arch + +- name: (arch) FZF install + community.general.pacman: + name: fzf + state: present + update_cache: true + become: true diff --git a/roles/fzf/tasks/install/debian.yml b/roles/fzf/tasks/install/debian.yml new file mode 100644 index 0000000..a5a222f --- /dev/null +++ b/roles/fzf/tasks/install/debian.yml @@ -0,0 +1,9 @@ +--- +# FZF on Debian + +- name: (deb) FZF install + ansible.builtin.apt: + name: fzf + state: present + update_cache: true + become: true diff --git a/roles/fzf/tasks/install/redhat.yml b/roles/fzf/tasks/install/redhat.yml new file mode 100644 index 0000000..be10a09 --- /dev/null +++ b/roles/fzf/tasks/install/redhat.yml @@ -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 diff --git a/roles/fzf/tasks/install/void.yml b/roles/fzf/tasks/install/void.yml new file mode 100644 index 0000000..78dbb0d --- /dev/null +++ b/roles/fzf/tasks/install/void.yml @@ -0,0 +1,9 @@ +--- +# FZF - install on Void + +- name: (void) FZF - install + community.general.xbps: + name: fzf + state: present + update_cache: true + become: true diff --git a/roles/fzf/tasks/main.yml b/roles/fzf/tasks/main.yml new file mode 100644 index 0000000..deb6a7e --- /dev/null +++ b/roles/fzf/tasks/main.yml @@ -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 diff --git a/roles/git/tasks/configuration.yml b/roles/git/tasks/configuration.yml new file mode 100644 index 0000000..50d0c84 --- /dev/null +++ b/roles/git/tasks/configuration.yml @@ -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 diff --git a/roles/git/tasks/install/alpine.yml b/roles/git/tasks/install/alpine.yml new file mode 100644 index 0000000..6d98dcc --- /dev/null +++ b/roles/git/tasks/install/alpine.yml @@ -0,0 +1,9 @@ +--- +# git on alpine + +- name: (alp) installing git + community.general.apk: + name: git + state: present + update_cache: true + become: true diff --git a/roles/git/tasks/install/archlinux.yml b/roles/git/tasks/install/archlinux.yml new file mode 100644 index 0000000..3a3d7ec --- /dev/null +++ b/roles/git/tasks/install/archlinux.yml @@ -0,0 +1,9 @@ +--- +# git on Archlinux + +- name: (arch) installing git + community.general.pacman: + name: git + state: present + update_cache: true + become: true diff --git a/roles/git/tasks/install/debian.yml b/roles/git/tasks/install/debian.yml new file mode 100644 index 0000000..facc765 --- /dev/null +++ b/roles/git/tasks/install/debian.yml @@ -0,0 +1,9 @@ +--- +# git on Debian + +- name: (deb) installing git + ansible.builtin.apt: + name: git + state: present + update_cache: true + become: true diff --git a/roles/git/tasks/install/redhat.yml b/roles/git/tasks/install/redhat.yml new file mode 100644 index 0000000..2b57073 --- /dev/null +++ b/roles/git/tasks/install/redhat.yml @@ -0,0 +1,9 @@ +--- +# git on RedHat + +- name: (rHa) installing git + ansible.builtin.yum: + name: git + state: present + update_cache: true + become: true diff --git a/roles/git/tasks/install/void.yml b/roles/git/tasks/install/void.yml new file mode 100644 index 0000000..b4f4f6b --- /dev/null +++ b/roles/git/tasks/install/void.yml @@ -0,0 +1,9 @@ +--- +# git on void + +- name: (void) installing git + community.general.xbps: + name: git + state: present + update_cache: true + become: true diff --git a/roles/git/tasks/main.yml b/roles/git/tasks/main.yml new file mode 100644 index 0000000..a124777 --- /dev/null +++ b/roles/git/tasks/main.yml @@ -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 diff --git a/roles/pip/tasks/install/alpine.yml b/roles/pip/tasks/install/alpine.yml new file mode 100644 index 0000000..0552d0c --- /dev/null +++ b/roles/pip/tasks/install/alpine.yml @@ -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 diff --git a/roles/pip/tasks/install/archlinux.yml b/roles/pip/tasks/install/archlinux.yml new file mode 100644 index 0000000..c21f876 --- /dev/null +++ b/roles/pip/tasks/install/archlinux.yml @@ -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 diff --git a/roles/pip/tasks/install/debian.yml b/roles/pip/tasks/install/debian.yml new file mode 100644 index 0000000..f9dd2e8 --- /dev/null +++ b/roles/pip/tasks/install/debian.yml @@ -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 diff --git a/roles/pip/tasks/install/redhat.yml b/roles/pip/tasks/install/redhat.yml new file mode 100644 index 0000000..af3eb73 --- /dev/null +++ b/roles/pip/tasks/install/redhat.yml @@ -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 diff --git a/roles/pip/tasks/install/void.yml b/roles/pip/tasks/install/void.yml new file mode 100644 index 0000000..78f0ce6 --- /dev/null +++ b/roles/pip/tasks/install/void.yml @@ -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 diff --git a/roles/pip/tasks/main.yml b/roles/pip/tasks/main.yml new file mode 100644 index 0000000..e19b281 --- /dev/null +++ b/roles/pip/tasks/main.yml @@ -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 diff --git a/roles/rclone/tasks/install/alpine.yml b/roles/rclone/tasks/install/alpine.yml new file mode 100644 index 0000000..e13d291 --- /dev/null +++ b/roles/rclone/tasks/install/alpine.yml @@ -0,0 +1,7 @@ +--- +- name: (alp) installing rclone + community.general.apk: + name: rclone + state: present + update_cache: true + become: true diff --git a/roles/rclone/tasks/install/archlinux.yml b/roles/rclone/tasks/install/archlinux.yml new file mode 100644 index 0000000..30b8b42 --- /dev/null +++ b/roles/rclone/tasks/install/archlinux.yml @@ -0,0 +1,7 @@ +--- +- name: (arch) installing rclone + community.general.pacman: + name: rclone + state: present + update_cache: true + become: true diff --git a/roles/rclone/tasks/install/debian.yml b/roles/rclone/tasks/install/debian.yml new file mode 100644 index 0000000..0e47d19 --- /dev/null +++ b/roles/rclone/tasks/install/debian.yml @@ -0,0 +1,7 @@ +--- +- name: (deb) installing rclone + ansible.builtin.apt: + name: rclone + state: present + update_cache: true + become: true diff --git a/roles/rclone/tasks/install/redhat.yml b/roles/rclone/tasks/install/redhat.yml new file mode 100644 index 0000000..d22be90 --- /dev/null +++ b/roles/rclone/tasks/install/redhat.yml @@ -0,0 +1,7 @@ +--- +- name: (rHa) installing rclone + ansible.builtin.yum: + name: rclone + state: present + update_cache: true + become: true diff --git a/roles/rclone/tasks/install/void.yml b/roles/rclone/tasks/install/void.yml new file mode 100644 index 0000000..3cfaca3 --- /dev/null +++ b/roles/rclone/tasks/install/void.yml @@ -0,0 +1,7 @@ +--- +- name: (void) installing rclone + community.general.xbps: + name: rclone + state: present + update_cache: true + become: true diff --git a/roles/rclone/tasks/main.yml b/roles/rclone/tasks/main.yml new file mode 100644 index 0000000..bdbbd33 --- /dev/null +++ b/roles/rclone/tasks/main.yml @@ -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 diff --git a/roles/rsync/tasks/install/alpine.yml b/roles/rsync/tasks/install/alpine.yml new file mode 100644 index 0000000..ee814e3 --- /dev/null +++ b/roles/rsync/tasks/install/alpine.yml @@ -0,0 +1,9 @@ +--- +# rsync + +- name: (alp) installing rsync + community.general.apk: + name: rsync + state: present + update_cache: true + become: true diff --git a/roles/rsync/tasks/install/archlinux.yml b/roles/rsync/tasks/install/archlinux.yml new file mode 100644 index 0000000..6bbcd1e --- /dev/null +++ b/roles/rsync/tasks/install/archlinux.yml @@ -0,0 +1,7 @@ +--- +- name: (arch) installing rsync + community.general.pacman: + name: rsync + state: present + update_cache: true + become: true diff --git a/roles/rsync/tasks/install/debian.yml b/roles/rsync/tasks/install/debian.yml new file mode 100644 index 0000000..5393a44 --- /dev/null +++ b/roles/rsync/tasks/install/debian.yml @@ -0,0 +1,7 @@ +--- +- name: (deb) installing rsync + ansible.builtin.apt: + name: rsync + state: present + update_cache: true + become: true diff --git a/roles/rsync/tasks/install/redhat.yml b/roles/rsync/tasks/install/redhat.yml new file mode 100644 index 0000000..4638c2a --- /dev/null +++ b/roles/rsync/tasks/install/redhat.yml @@ -0,0 +1,7 @@ +--- +- name: (rHa) installing rsync + ansible.builtin.yum: + name: rsync + state: present + update_cache: true + become: true diff --git a/roles/rsync/tasks/install/void.yml b/roles/rsync/tasks/install/void.yml new file mode 100644 index 0000000..97266ae --- /dev/null +++ b/roles/rsync/tasks/install/void.yml @@ -0,0 +1,7 @@ +--- +- name: (void) installing rsync + community.general.xbps: + name: rsync + state: present + update_cache: true + become: true diff --git a/roles/rsync/tasks/main.yml b/roles/rsync/tasks/main.yml new file mode 100644 index 0000000..54a8bc1 --- /dev/null +++ b/roles/rsync/tasks/main.yml @@ -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 diff --git a/roles/tmux/defaults/main.yml b/roles/tmux/defaults/main.yml new file mode 100644 index 0000000..acd7660 --- /dev/null +++ b/roles/tmux/defaults/main.yml @@ -0,0 +1,2 @@ +--- +dotfdir: "{{ lookup('ansible.builtin.env', 'HOME' ) }}/.dotfiles" diff --git a/roles/tmux/tasks/configuration.yml b/roles/tmux/tasks/configuration.yml new file mode 100644 index 0000000..e236519 --- /dev/null +++ b/roles/tmux/tasks/configuration.yml @@ -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 diff --git a/roles/tmux/tasks/install/alpine.yml b/roles/tmux/tasks/install/alpine.yml new file mode 100644 index 0000000..0166d7b --- /dev/null +++ b/roles/tmux/tasks/install/alpine.yml @@ -0,0 +1,7 @@ +--- +- name: (alp) installing tmux + community.general.apk: + name: tmux + state: present + update_cache: true + become: true diff --git a/roles/tmux/tasks/install/archlinux.yml b/roles/tmux/tasks/install/archlinux.yml new file mode 100644 index 0000000..548d6dd --- /dev/null +++ b/roles/tmux/tasks/install/archlinux.yml @@ -0,0 +1,7 @@ +--- +- name: (arch) installing tmux + community.general.pacman: + name: tmux + state: present + update_cache: true + become: true diff --git a/roles/tmux/tasks/install/debian.yml b/roles/tmux/tasks/install/debian.yml new file mode 100644 index 0000000..70c7a5b --- /dev/null +++ b/roles/tmux/tasks/install/debian.yml @@ -0,0 +1,7 @@ +--- +- name: (deb) installing tmux + ansible.builtin.apt: + name: tmux + state: present + update_cache: true + become: true diff --git a/roles/tmux/tasks/install/redhat.yml b/roles/tmux/tasks/install/redhat.yml new file mode 100644 index 0000000..c00d11f --- /dev/null +++ b/roles/tmux/tasks/install/redhat.yml @@ -0,0 +1,7 @@ +--- +- name: (rHa) installing tmux + ansible.builtin.yum: + name: tmux + state: present + update_cache: true + become: true diff --git a/roles/tmux/tasks/install/void.yml b/roles/tmux/tasks/install/void.yml new file mode 100644 index 0000000..fc4e64b --- /dev/null +++ b/roles/tmux/tasks/install/void.yml @@ -0,0 +1,7 @@ +--- +- name: (void) installing tmux + community.general.xbps: + name: tmux + state: present + update_cache: true + become: true diff --git a/roles/tmux/tasks/main.yml b/roles/tmux/tasks/main.yml new file mode 100644 index 0000000..58ece0e --- /dev/null +++ b/roles/tmux/tasks/main.yml @@ -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." diff --git a/roles/vim-plug/handlers/main.yml b/roles/vim-plug/handlers/main.yml new file mode 100644 index 0000000..ae9d155 --- /dev/null +++ b/roles/vim-plug/handlers/main.yml @@ -0,0 +1,5 @@ +--- +- name: repolist + ansible.builtin.command: yum repolist + become: true + become_user: root diff --git a/roles/vim-plug/tasks/depend/alpine.yml b/roles/vim-plug/tasks/depend/alpine.yml new file mode 100644 index 0000000..953b4a6 --- /dev/null +++ b/roles/vim-plug/tasks/depend/alpine.yml @@ -0,0 +1,10 @@ +--- +- name: (alp) installing plugin dependencies + community.general.apk: + name: + - nodejs + - npm + - yarn + state: present + update_cache: true + become: true diff --git a/roles/vim-plug/tasks/depend/archlinux.yml b/roles/vim-plug/tasks/depend/archlinux.yml new file mode 100644 index 0000000..1cc9c63 --- /dev/null +++ b/roles/vim-plug/tasks/depend/archlinux.yml @@ -0,0 +1,10 @@ +--- +- name: (arch) installing plugin dependencies + community.general.pacman: + name: + - nodejs + - npm + - yarn + state: present + update_cache: true + become: true diff --git a/roles/vim-plug/tasks/depend/debian.yml b/roles/vim-plug/tasks/depend/debian.yml new file mode 100644 index 0000000..71415cc --- /dev/null +++ b/roles/vim-plug/tasks/depend/debian.yml @@ -0,0 +1,10 @@ +--- +- name: (deb) installing plugin dependencies + ansible.builtin.apt: + name: + - nodejs + - npm + - yarnpkg + state: present + update_cache: true + become: true diff --git a/roles/vim-plug/tasks/depend/redhat.yml b/roles/vim-plug/tasks/depend/redhat.yml new file mode 100644 index 0000000..c797243 --- /dev/null +++ b/roles/vim-plug/tasks/depend/redhat.yml @@ -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 diff --git a/roles/vim-plug/tasks/depend/void.yml b/roles/vim-plug/tasks/depend/void.yml new file mode 100644 index 0000000..b9b5b16 --- /dev/null +++ b/roles/vim-plug/tasks/depend/void.yml @@ -0,0 +1,9 @@ +--- +- name: (void) installing plugin dependencies + community.general.xbps: + name: + - nodejs + - yarn-bin + state: present + update_cache: true + become: true diff --git a/roles/vim-plug/tasks/installation.yml b/roles/vim-plug/tasks/installation.yml new file mode 100644 index 0000000..eda335f --- /dev/null +++ b/roles/vim-plug/tasks/installation.yml @@ -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' diff --git a/roles/vim-plug/tasks/main.yml b/roles/vim-plug/tasks/main.yml new file mode 100644 index 0000000..fbce5b1 --- /dev/null +++ b/roles/vim-plug/tasks/main.yml @@ -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 diff --git a/roles/vim/defaults/main.yml b/roles/vim/defaults/main.yml new file mode 100644 index 0000000..acd7660 --- /dev/null +++ b/roles/vim/defaults/main.yml @@ -0,0 +1,2 @@ +--- +dotfdir: "{{ lookup('ansible.builtin.env', 'HOME' ) }}/.dotfiles" diff --git a/roles/vim/tasks/configuration.yml b/roles/vim/tasks/configuration.yml new file mode 100644 index 0000000..65757c8 --- /dev/null +++ b/roles/vim/tasks/configuration.yml @@ -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 diff --git a/roles/vim/tasks/install/alpine.yml b/roles/vim/tasks/install/alpine.yml new file mode 100644 index 0000000..f4ed425 --- /dev/null +++ b/roles/vim/tasks/install/alpine.yml @@ -0,0 +1,7 @@ +--- +- name: (alp) installing vim + community.general.apk: + name: vim + state: present + update_cache: true + become: true diff --git a/roles/vim/tasks/install/archlinux.yml b/roles/vim/tasks/install/archlinux.yml new file mode 100644 index 0000000..9346c34 --- /dev/null +++ b/roles/vim/tasks/install/archlinux.yml @@ -0,0 +1,7 @@ +--- +- name: (arch) installing vim + community.general.pacman: + name: vim + state: present + update_cache: true + become: true diff --git a/roles/vim/tasks/install/debian.yml b/roles/vim/tasks/install/debian.yml new file mode 100644 index 0000000..11dd3dd --- /dev/null +++ b/roles/vim/tasks/install/debian.yml @@ -0,0 +1,7 @@ +--- +- name: (deb) installing vim + ansible.builtin.apt: + name: vim + state: present + update_cache: true + become: true diff --git a/roles/vim/tasks/install/redhat.yml b/roles/vim/tasks/install/redhat.yml new file mode 100644 index 0000000..5ccdf0f --- /dev/null +++ b/roles/vim/tasks/install/redhat.yml @@ -0,0 +1,7 @@ +--- +- name: (rHa) installing vim + ansible.builtin.yum: + name: vim + state: present + update_cache: true + become: true diff --git a/roles/vim/tasks/install/void.yml b/roles/vim/tasks/install/void.yml new file mode 100644 index 0000000..fa3955f --- /dev/null +++ b/roles/vim/tasks/install/void.yml @@ -0,0 +1,7 @@ +--- +- name: (void) installing Vim + community.general.xbps: + name: vim + state: present + update_cache: true + become: true diff --git a/roles/vim/tasks/main.yml b/roles/vim/tasks/main.yml new file mode 100644 index 0000000..0b704d6 --- /dev/null +++ b/roles/vim/tasks/main.yml @@ -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 diff --git a/roles/zsh/defaults/main.yml b/roles/zsh/defaults/main.yml new file mode 100644 index 0000000..b884bf7 --- /dev/null +++ b/roles/zsh/defaults/main.yml @@ -0,0 +1,2 @@ +--- +dotfdir: "{{ lookup('ansible.builtin.env', 'HOME' }}/.dotfiles" diff --git a/roles/zsh/tasks/config/alpine.yml b/roles/zsh/tasks/config/alpine.yml new file mode 100644 index 0000000..064a386 --- /dev/null +++ b/roles/zsh/tasks/config/alpine.yml @@ -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 diff --git a/roles/zsh/tasks/config/archlinux.yml b/roles/zsh/tasks/config/archlinux.yml new file mode 100644 index 0000000..ed90256 --- /dev/null +++ b/roles/zsh/tasks/config/archlinux.yml @@ -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' diff --git a/roles/zsh/tasks/config/debian.yml b/roles/zsh/tasks/config/debian.yml new file mode 100644 index 0000000..11e50f2 --- /dev/null +++ b/roles/zsh/tasks/config/debian.yml @@ -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' diff --git a/roles/zsh/tasks/config/main.yml b/roles/zsh/tasks/config/main.yml new file mode 100644 index 0000000..449314e --- /dev/null +++ b/roles/zsh/tasks/config/main.yml @@ -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 diff --git a/roles/zsh/tasks/config/redhat.yml b/roles/zsh/tasks/config/redhat.yml new file mode 100644 index 0000000..945b57a --- /dev/null +++ b/roles/zsh/tasks/config/redhat.yml @@ -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 diff --git a/roles/zsh/tasks/config/void.yml b/roles/zsh/tasks/config/void.yml new file mode 100644 index 0000000..a4e6bb1 --- /dev/null +++ b/roles/zsh/tasks/config/void.yml @@ -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 diff --git a/roles/zsh/tasks/configuration.yml b/roles/zsh/tasks/configuration.yml new file mode 100644 index 0000000..28ed259 --- /dev/null +++ b/roles/zsh/tasks/configuration.yml @@ -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" diff --git a/roles/zsh/tasks/install/alpine.yml b/roles/zsh/tasks/install/alpine.yml new file mode 100644 index 0000000..caff7e6 --- /dev/null +++ b/roles/zsh/tasks/install/alpine.yml @@ -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 diff --git a/roles/zsh/tasks/install/archlinux.yml b/roles/zsh/tasks/install/archlinux.yml new file mode 100644 index 0000000..7f92288 --- /dev/null +++ b/roles/zsh/tasks/install/archlinux.yml @@ -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 diff --git a/roles/zsh/tasks/install/debian.yml b/roles/zsh/tasks/install/debian.yml new file mode 100644 index 0000000..184d45c --- /dev/null +++ b/roles/zsh/tasks/install/debian.yml @@ -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 diff --git a/roles/zsh/tasks/install/redhat.yml b/roles/zsh/tasks/install/redhat.yml new file mode 100644 index 0000000..255c6d5 --- /dev/null +++ b/roles/zsh/tasks/install/redhat.yml @@ -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 diff --git a/roles/zsh/tasks/install/void.yml b/roles/zsh/tasks/install/void.yml new file mode 100644 index 0000000..a1a47c5 --- /dev/null +++ b/roles/zsh/tasks/install/void.yml @@ -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 diff --git a/roles/zsh/tasks/main.yml b/roles/zsh/tasks/main.yml new file mode 100644 index 0000000..bda4393 --- /dev/null +++ b/roles/zsh/tasks/main.yml @@ -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