From ec3765ce5c42821c8ac7f36fb02e6de358c014e9 Mon Sep 17 00:00:00 2001 From: Marc Cataford Date: Sun, 29 Sep 2024 13:02:23 -0400 Subject: [PATCH] refactor: split shell, editor tweaks --- home.yml | 3 ++- .../files/extras.vim | 0 roles/editor-tweaks/tasks/main.yml | 6 ++++++ .../files/gh-dash.yml | 0 .../files/shell_extras | 0 .../files/starship.toml | 0 .../{managed-blocks => shell-tweaks}/tasks/main.yml | 12 +++++++----- roles/system-packages/tasks/main.yml | 7 ------- 8 files changed, 15 insertions(+), 13 deletions(-) rename roles/{managed-blocks => editor-tweaks}/files/extras.vim (100%) create mode 100644 roles/editor-tweaks/tasks/main.yml rename roles/{managed-blocks => shell-tweaks}/files/gh-dash.yml (100%) rename roles/{managed-blocks => shell-tweaks}/files/shell_extras (100%) rename roles/{managed-blocks => shell-tweaks}/files/starship.toml (100%) rename roles/{managed-blocks => shell-tweaks}/tasks/main.yml (77%) diff --git a/home.yml b/home.yml index e95510b..b319cdf 100644 --- a/home.yml +++ b/home.yml @@ -3,5 +3,6 @@ hosts: localhost roles: - system-packages - - managed-blocks + - shell-tweaks + - editor-tweaks - tool-config diff --git a/roles/managed-blocks/files/extras.vim b/roles/editor-tweaks/files/extras.vim similarity index 100% rename from roles/managed-blocks/files/extras.vim rename to roles/editor-tweaks/files/extras.vim diff --git a/roles/editor-tweaks/tasks/main.yml b/roles/editor-tweaks/tasks/main.yml new file mode 100644 index 0000000..5d01071 --- /dev/null +++ b/roles/editor-tweaks/tasks/main.yml @@ -0,0 +1,6 @@ +--- +- name: Add nvim managed block + blockinfile: + path: "{{ lookup('ansible.builtin.env', 'HOME') }}/.config/nvim/init.vim" + marker: "\" Marc's env managed block - {mark}" + block: "{{ lookup('ansible.builtin.file', 'files/extras.vim') }}" diff --git a/roles/managed-blocks/files/gh-dash.yml b/roles/shell-tweaks/files/gh-dash.yml similarity index 100% rename from roles/managed-blocks/files/gh-dash.yml rename to roles/shell-tweaks/files/gh-dash.yml diff --git a/roles/managed-blocks/files/shell_extras b/roles/shell-tweaks/files/shell_extras similarity index 100% rename from roles/managed-blocks/files/shell_extras rename to roles/shell-tweaks/files/shell_extras diff --git a/roles/managed-blocks/files/starship.toml b/roles/shell-tweaks/files/starship.toml similarity index 100% rename from roles/managed-blocks/files/starship.toml rename to roles/shell-tweaks/files/starship.toml diff --git a/roles/managed-blocks/tasks/main.yml b/roles/shell-tweaks/tasks/main.yml similarity index 77% rename from roles/managed-blocks/tasks/main.yml rename to roles/shell-tweaks/tasks/main.yml index 3ffc387..1cfa572 100644 --- a/roles/managed-blocks/tasks/main.yml +++ b/roles/shell-tweaks/tasks/main.yml @@ -1,14 +1,16 @@ --- +- name: Install OMZsh + shell: | + sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" + args: + creates: "{{ lookup('ansible.builtin.env', 'HOME') }}/.oh-my-zsh" +- name: Install gh CLI extensions (gh-dash) + command: gh extension install dlvhdr/gh-dash - name: Add zsh managed block blockinfile: path: "{{ lookup('ansible.builtin.env', 'HOME') }}/.zshrc" marker: "# Marc's env managed block - {mark}" block: "{{ lookup('ansible.builtin.file', 'files/shell_extras') }}" -- name: Add nvim managed block - blockinfile: - path: "{{ lookup('ansible.builtin.env', 'HOME') }}/.config/nvim/init.vim" - marker: "\" Marc's env managed block - {mark}" - block: "{{ lookup('ansible.builtin.file', 'files/extras.vim') }}" - name: Add starship managed block blockinfile: path: "{{ lookup('ansible.builtin.env', 'HOME') }}/.config/starship.toml" diff --git a/roles/system-packages/tasks/main.yml b/roles/system-packages/tasks/main.yml index 5091ebf..9022c47 100644 --- a/roles/system-packages/tasks/main.yml +++ b/roles/system-packages/tasks/main.yml @@ -9,18 +9,11 @@ pkg: - zsh - tmux -- name: Install OMZsh - shell: | - sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" - args: - creates: "{{ lookup('ansible.builtin.env', 'HOME') }}/.oh-my-zsh" - name: Install CLI tooling apt: pkg: - shellcheck - gh -- name: Install gh CLI extensions (gh-dash) - command: gh extension install dlvhdr/gh-dash - name: Install DB-related tooling apt: pkg: