From 7217241c87516875cc6f882a9125403b97bf3e06 Mon Sep 17 00:00:00 2001 From: Nikolaos Boutalas Date: Fri, 5 Jan 2024 03:50:50 +0200 Subject: Minor changes --- tasks/dependencies.yml | 13 +++++++++++ tasks/dependencies/all.yml | 20 ----------------- tasks/dependencies/fedora.yml | 6 ----- tasks/dependencies/ubuntu.yml | 6 ----- tasks/node.yml | 29 ------------------------ tasks/sdkman.yml | 20 +---------------- tasks/ssh.yml | 9 -------- tasks/tmux.yml | 7 ------ tasks/zsh.yml | 52 ------------------------------------------- 9 files changed, 14 insertions(+), 148 deletions(-) create mode 100644 tasks/dependencies.yml delete mode 100644 tasks/dependencies/all.yml delete mode 100644 tasks/dependencies/fedora.yml delete mode 100644 tasks/dependencies/ubuntu.yml delete mode 100644 tasks/ssh.yml delete mode 100644 tasks/tmux.yml delete mode 100644 tasks/zsh.yml (limited to 'tasks') diff --git a/tasks/dependencies.yml b/tasks/dependencies.yml new file mode 100644 index 0000000..baba4a2 --- /dev/null +++ b/tasks/dependencies.yml @@ -0,0 +1,13 @@ +- name: Update Aptitude + become: true + ansible.builtin.apt: + update_cache: true + tags: + - dependencies + +- name: Install dependencies + become: true + ansible.builtin.package: + name: [curl, git, docker, fzf, tmux, stow, unzip, zip, neovim, zsh, ripgrep] + tags: + - dependencies diff --git a/tasks/dependencies/all.yml b/tasks/dependencies/all.yml deleted file mode 100644 index aa05885..0000000 --- a/tasks/dependencies/all.yml +++ /dev/null @@ -1,20 +0,0 @@ -- name: Install Ubuntu dependencies - ansible.builtin.import_tasks: - file: tasks/dependencies/ubuntu.yml - when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu' - tags: - - always - -- name: Install Fedora dependencies - ansible.builtin.import_tasks: - file: tasks/dependencies/fedora.yml - when: ansible_distribution == 'Fedora' - tags: - - always - -- name: Install dependencies - become: true - ansible.builtin.package: - name: [curl, git, zsh, docker, fzf, tmux, stow, unzip, zip] - tags: - - always diff --git a/tasks/dependencies/fedora.yml b/tasks/dependencies/fedora.yml deleted file mode 100644 index df554c6..0000000 --- a/tasks/dependencies/fedora.yml +++ /dev/null @@ -1,6 +0,0 @@ -- name: Install which - become: true - ansible.builtin.package: - name: which - tags: - - always diff --git a/tasks/dependencies/ubuntu.yml b/tasks/dependencies/ubuntu.yml deleted file mode 100644 index 742fda3..0000000 --- a/tasks/dependencies/ubuntu.yml +++ /dev/null @@ -1,6 +0,0 @@ -- name: Update Aptitude - become: true - ansible.builtin.apt: - update_cache: true - tags: - - always diff --git a/tasks/node.yml b/tasks/node.yml index 9699e22..5ca660b 100644 --- a/tasks/node.yml +++ b/tasks/node.yml @@ -11,32 +11,3 @@ changed_when: true tags: - node - -- name: Enable nvm - ansible.builtin.lineinfile: - path: "~/.config/zsh/.zshrc" - line: | - export NVM_DIR=~/.nvm - [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" - autoload -U add-zsh-hook - load-nvmrc() { - local node_version="$(nvm version)" - local nvmrc_path="$(nvm_find_nvmrc)" - - if [ -n "$nvmrc_path" ]; then - local nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")") - - if [ "$nvmrc_node_version" = "N/A" ]; then - nvm install - elif [ "$nvmrc_node_version" != "$node_version" ]; then - nvm use - fi - elif [ "$node_version" != "$(nvm version default)" ]; then - echo "Reverting to nvm default version" - nvm use default - fi - } - add-zsh-hook chpwd load-nvmrc - load-nvmrc - tags: - - node diff --git a/tasks/sdkman.yml b/tasks/sdkman.yml index e87a4c0..42186b7 100644 --- a/tasks/sdkman.yml +++ b/tasks/sdkman.yml @@ -1,6 +1,6 @@ - name: Fetch sdkman installation script ansible.builtin.get_url: - url: https://get.sdkman.io?rcupdate=false + url: https://get.sdkman.io dest: /tmp/sdkman_install.sh mode: '0755' tags: @@ -11,21 +11,3 @@ changed_when: true tags: - sdkman - -- name: Enable sdkman - ansible.builtin.lineinfile: - path: "~/.config/zsh/.zshrc" - line: | - #THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!! - export SDKMAN_DIR="$HOME/.sdkman" - [[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh" - tags: - - sdkman - -- name: Configure sdkman_auto_env - ansible.builtin.lineinfile: - path: "~/.sdkman/etc/config" - regexp: '^sdkman_auto_env=' - line: sdkman_auto_env=true - tags: - - sdkman diff --git a/tasks/ssh.yml b/tasks/ssh.yml deleted file mode 100644 index af4f923..0000000 --- a/tasks/ssh.yml +++ /dev/null @@ -1,9 +0,0 @@ -- name: Copy SSH keys - ansible.builtin.copy: - src: ./ssh/ - dest: ~/.ssh - owner: "{{ ansible_user_id }}" - group: "{{ ansible_user_id }}" - mode: '0600' - tags: - - ssh diff --git a/tasks/tmux.yml b/tasks/tmux.yml deleted file mode 100644 index 8863d64..0000000 --- a/tasks/tmux.yml +++ /dev/null @@ -1,7 +0,0 @@ -- name: Install tmux plugin manager - ansible.builtin.git: - repo: 'https://github.com/tmux-plugins/tpm' - dest: "~/.tmux/plugins/tpm" - version: master - tags: - - tmux diff --git a/tasks/zsh.yml b/tasks/zsh.yml deleted file mode 100644 index 5301496..0000000 --- a/tasks/zsh.yml +++ /dev/null @@ -1,52 +0,0 @@ -- name: Change default shell - become: true - ansible.builtin.shell: "usermod -s $(which zsh) {{ ansible_user_id }}" - changed_when: true - tags: - - zsh - -- name: Create .zshenv - ansible.builtin.shell: "echo \"ZDOTDIR=~/.config/zsh\" > ~/.zshenv" - changed_when: true - tags: - - zsh - -- name: Install Oh My Zsh - ansible.builtin.shell: zsh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" - changed_when: true - tags: - - zsh - -- name: Install zsh-autosuggestions plugin - ansible.builtin.git: - repo: 'https://github.com/zsh-users/zsh-autosuggestions.git' - dest: "~/.config/zsh/ohmyzsh/plugins/zsh-autosuggestions" - version: master - tags: - - zsh - -- name: Install zsh-syntax-highlighting plugin - ansible.builtin.git: - repo: 'https://github.com/zsh-users/zsh-syntax-highlighting.git' - dest: "~/.config/zsh/ohmyzsh/plugins/zsh-syntax-highlighting" - version: master - tags: - - zsh - -- name: Enable ZSH plugins - ansible.builtin.lineinfile: - path: "~/.config/zsh/.zshrc" - regexp: '^plugins=' - line: plugins=(git tmux zsh-autosuggestions zsh-syntax-highlighting) - tags: - - zsh - -- name: Enable tmux autostart - ansible.builtin.lineinfile: - path: "~/.config/zsh/.zshrc" - line: | - if [[ -z $TMUX ]]; then - tmux -u attach || exec tmux -u new-session && exit - fi - tags: - - zsh -- cgit v1.2.3