From e8fc9fffaa25e1f48c5720d5d756dddc361fd96e Mon Sep 17 00:00:00 2001 From: Emiliano Vavassori Date: Tue, 1 Oct 2024 09:17:39 +0200 Subject: [PATCH] Rimozione indicazione esplicita dello username. --- roles/antidote/tasks/configuration.yml | 5 ++--- roles/antidote/tasks/installation.yml | 9 ++++---- roles/fzf/tasks/install/redhat.yml | 10 ++++----- roles/git/defaults/main.yml | 3 +++ roles/git/tasks/configuration.yml | 8 +++---- roles/nix/tasks/configuration.yml | 8 +++---- roles/tmux/tasks/configuration.yml | 17 +++++--------- roles/vim-plug/tasks/installation.yml | 9 +++----- roles/vim/tasks/configuration.yml | 8 ++----- roles/zsh/tasks/config/alpine.yml | 2 -- roles/zsh/tasks/config/archlinux.yml | 4 ---- roles/zsh/tasks/config/debian.yml | 4 ---- roles/zsh/tasks/config/main.yml | 14 +++++------- roles/zsh/tasks/config/redhat.yml | 2 -- roles/zsh/tasks/config/void.yml | 2 -- roles/zsh/tasks/configuration.yml | 31 -------------------------- 16 files changed, 37 insertions(+), 99 deletions(-) create mode 100644 roles/git/defaults/main.yml delete mode 100644 roles/zsh/tasks/configuration.yml diff --git a/roles/antidote/tasks/configuration.yml b/roles/antidote/tasks/configuration.yml index 91269f3..df2a340 100644 --- a/roles/antidote/tasks/configuration.yml +++ b/roles/antidote/tasks/configuration.yml @@ -3,10 +3,8 @@ - name: Assuring the conf.d folder exists ansible.builtin.file: - dest: "{{ lookup('ansible.builtin.env', 'HOME' ) }}/.zsh/conf.d" + dest: "{{ lookup('ansible.builtin.env', 'HOME') }}/.zsh/conf.d" state: directory - owner: syntaxerrormmm - group: syntaxerrormmm mode: '0755' - name: Building lazy-loading list @@ -15,3 +13,4 @@ antidote bundle < {{ dotfdir }}/zsh/antibody_plugins.txt > ~/.zsh/conf.d/000_antidote.zsh args: executable: /usr/bin/zsh + changed_when: true diff --git a/roles/antidote/tasks/installation.yml b/roles/antidote/tasks/installation.yml index 49c5849..82b4cb5 100644 --- a/roles/antidote/tasks/installation.yml +++ b/roles/antidote/tasks/installation.yml @@ -3,14 +3,13 @@ - name: Creating destination folder ansible.builtin.file: - dest: "{{ lookup('ansible.builtin.env', 'HOME' ) }}/.zsh/antidote" + dest: "{{ lookup('ansible.builtin.env', 'HOME') }}/.zsh/antidote" state: directory - owner: syntaxerrormmm - group: syntaxerrormmm - mode: "0755" + mode: '0755' - name: Installing antidote with git + # noqa: latest[git] ansible.builtin.git: repo: "https://github.com/mattmc3/antidote.git" - dest: "{{ lookup('ansible.builtin.env','HOME' ) }}/.zsh/antidote" + dest: "{{ lookup('ansible.builtin.env', 'HOME') }}/.zsh/antidote" depth: 1 diff --git a/roles/fzf/tasks/install/redhat.yml b/roles/fzf/tasks/install/redhat.yml index be10a09..c292742 100644 --- a/roles/fzf/tasks/install/redhat.yml +++ b/roles/fzf/tasks/install/redhat.yml @@ -4,18 +4,18 @@ - name: (rHa) FZF - Build directory ansible.builtin.file: - dest: "{{ lookup('ansible.builtin.env', 'HOME' ) }}/.fzf" + dest: "{{ lookup('ansible.builtin.env', 'HOME') }}/.fzf" state: directory - owner: syntaxerrormmm - group: syntaxerrormmm mode: '0755' - name: (rHa) FZF - clone from git ansible.builtin.git: + # noqa: latest[git] repo: https://github.com/junegunn/fzf.git depth: 1 - dest: "{{ lookup('ansible.builtin.env', 'HOME' ) }}/.fzf" + dest: "{{ lookup('ansible.builtin.env', 'HOME') }}/.fzf" - name: (rHa) FZF - Installing ansible.builtin.command: >- - {{ lookup('ansible.builtin.env', 'HOME' ) }}/.fzf/install + {{ lookup('ansible.builtin.env', 'HOME') }}/.fzf/install + changed_when: true diff --git a/roles/git/defaults/main.yml b/roles/git/defaults/main.yml new file mode 100644 index 0000000..3039ed4 --- /dev/null +++ b/roles/git/defaults/main.yml @@ -0,0 +1,3 @@ +--- +git_username: Emiliano Vavassori +git_email: syntaxerrormmm@gmail.com diff --git a/roles/git/tasks/configuration.yml b/roles/git/tasks/configuration.yml index 50d0c84..e553cb0 100644 --- a/roles/git/tasks/configuration.yml +++ b/roles/git/tasks/configuration.yml @@ -2,13 +2,13 @@ # Configuring git - name: Configuring git username - ansible.builtin.git_config: + community.general.git_config: name: user.name scope: global - value: "Emiliano Vavassori" + value: "{{ git_username }}" - name: Configuring git email - ansible.builtin.git_config: + community.general.git_config: name: user.email scope: global - value: syntaxerrormmm@gmail.com + value: "{{ git_email }}" diff --git a/roles/nix/tasks/configuration.yml b/roles/nix/tasks/configuration.yml index 79296d7..11790d3 100644 --- a/roles/nix/tasks/configuration.yml +++ b/roles/nix/tasks/configuration.yml @@ -1,9 +1,9 @@ --- # Configuring the nix installation. -- name: Adding syntaxerrormmm to nix-users +- name: Adding user to nix-users ansible.builtin.user: - name: syntaxerrormmm + name: "{{ ansible_user }}" groups: nix-users append: true become: true @@ -11,7 +11,5 @@ - name: Adding configuration to local user ansible.builtin.file: src: "{{ dotfdir }}/nix" - dest: "{{ lookup('ansible.builtin.env', 'HOME' ) }}/.config/nix" + dest: "{{ lookup('ansible.builtin.env', 'HOME') }}/.config/nix" state: link - owner: syntaxerrormmm - group: syntaxerrormmm diff --git a/roles/tmux/tasks/configuration.yml b/roles/tmux/tasks/configuration.yml index e236519..81bc15c 100644 --- a/roles/tmux/tasks/configuration.yml +++ b/roles/tmux/tasks/configuration.yml @@ -3,30 +3,25 @@ - name: Creating configuration folders ansible.builtin.file: - path: "{{ lookup('ansible.builtin.env', 'HOME' ) }}/.config/tmux/plugins" + path: "{{ lookup('ansible.builtin.env', 'HOME') }}/.config/tmux/plugins" state: directory - owner: syntaxerrormmm - group: syntaxerrormmm mode: '0755' - name: Getting tpm ansible.builtin.git: + # noqa: latest[git] repo: https://github.com/tmux-plugins/tpm.git depth: 1 - dest: "{{ lookup('ansible.builtin.env', 'HOME' ) }}/.config/tmux/plugins/tpm" + 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" + 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" + 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/vim-plug/tasks/installation.yml b/roles/vim-plug/tasks/installation.yml index eda335f..603ec08 100644 --- a/roles/vim-plug/tasks/installation.yml +++ b/roles/vim-plug/tasks/installation.yml @@ -6,15 +6,12 @@ - name: Creating autoload dir ansible.builtin.file: - path: "{{ lookup('ansible.builtin.env', 'HOME' ) }}/.vim/autoload" + path: "{{ lookup('ansible.builtin.env', 'HOME') }}/.vim/autoload" state: directory - owner: syntaxerrormmm - group: syntaxerrormmm + mode: '0755' - 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 + dest: "{{ lookup('ansible.builtin.env', 'HOME') }}/.vim/autoload/plug.vim" mode: '0644' diff --git a/roles/vim/tasks/configuration.yml b/roles/vim/tasks/configuration.yml index 65757c8..00b7891 100644 --- a/roles/vim/tasks/configuration.yml +++ b/roles/vim/tasks/configuration.yml @@ -4,15 +4,11 @@ - name: Linking main file ansible.builtin.file: src: "{{ dotfdir }}/vimrc" - dest: "{{ lookup('ansible.builtin.env', 'HOME' ) }}/.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" + dest: "{{ lookup('ansible.builtin.env', 'HOME') }}/.vim" state: link - owner: syntaxerrormmm - group: syntaxerrormmm diff --git a/roles/zsh/tasks/config/alpine.yml b/roles/zsh/tasks/config/alpine.yml index 064a386..991d9b3 100644 --- a/roles/zsh/tasks/config/alpine.yml +++ b/roles/zsh/tasks/config/alpine.yml @@ -6,5 +6,3 @@ 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 index ed90256..c7c1052 100644 --- a/roles/zsh/tasks/config/archlinux.yml +++ b/roles/zsh/tasks/config/archlinux.yml @@ -6,8 +6,6 @@ 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 @@ -15,6 +13,4 @@ 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 index 11e50f2..e61e3b1 100644 --- a/roles/zsh/tasks/config/debian.yml +++ b/roles/zsh/tasks/config/debian.yml @@ -6,8 +6,6 @@ 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 @@ -15,6 +13,4 @@ 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 index 449314e..4261c91 100644 --- a/roles/zsh/tasks/config/main.yml +++ b/roles/zsh/tasks/config/main.yml @@ -4,23 +4,19 @@ - name: Fixing base settings ansible.builtin.include_tasks: "{{ ansible_os_family | lower }}.yml" -- name: Set zsh as default shell for syntaxerrormmm +- name: Set zsh as default shell for user ansible.builtin.user: - name: syntaxerrormmm + name: "{{ ansible_user }}" shell: /usr/bin/zsh - name: Creating personal folder for customization ansible.builtin.file: - path: "{{ lookup('ansible.builtin.env', 'HOME' ) }}/.zsh/conf.d" + path: "{{ lookup('ansible.builtin.env', 'HOME') }}/.zsh/conf.d" state: directory - owner: syntaxerrormmm - group: syntaxerrormmm - mode: "0755" + mode: '0755' - name: Linking main file ansible.builtin.file: src: "{{ dotfdir }}/zshrc" - dest: "{{ lookup('ansible.builtin.env', 'HOME' ) }}/.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 index 945b57a..ded7435 100644 --- a/roles/zsh/tasks/config/redhat.yml +++ b/roles/zsh/tasks/config/redhat.yml @@ -6,5 +6,3 @@ 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 index a4e6bb1..10ebe67 100644 --- a/roles/zsh/tasks/config/void.yml +++ b/roles/zsh/tasks/config/void.yml @@ -6,5 +6,3 @@ 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 deleted file mode 100644 index 28ed259..0000000 --- a/roles/zsh/tasks/configuration.yml +++ /dev/null @@ -1,31 +0,0 @@ ---- -# 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"