From a938230bc6039d8d33ddc09b3eb6e625ea5e0f1b Mon Sep 17 00:00:00 2001 From: soblin Date: Mon, 19 Jan 2026 03:28:40 +0900 Subject: [PATCH] feat(ansible): install ghq Signed-off-by: soblin --- .config/fish/fish_plugins | 1 + .gitconfig | 2 ++ .../roles/dev_tools/tasks/commands/ghq.yaml | 30 +++++++++++++++++++ ansible/roles/dev_tools/tasks/install.yaml | 2 ++ .../roles/xdg_base_directory/tasks/main.yaml | 2 +- 5 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 ansible/roles/dev_tools/tasks/commands/ghq.yaml diff --git a/.config/fish/fish_plugins b/.config/fish/fish_plugins index 5afabd0..86a4285 100644 --- a/.config/fish/fish_plugins +++ b/.config/fish/fish_plugins @@ -1,3 +1,4 @@ jorgebucaran/fisher oh-my-fish/theme-bobthefish edc/bass +decors/fish-ghq diff --git a/.gitconfig b/.gitconfig index e1dc271..b3df583 100644 --- a/.gitconfig +++ b/.gitconfig @@ -38,3 +38,5 @@ cmd = difft "$LOCAL" "$REMOTE" [pager] difftool = true +[ghq] + root = ~/.ghq/src \ No newline at end of file diff --git a/ansible/roles/dev_tools/tasks/commands/ghq.yaml b/ansible/roles/dev_tools/tasks/commands/ghq.yaml new file mode 100644 index 0000000..03b689f --- /dev/null +++ b/ansible/roles/dev_tools/tasks/commands/ghq.yaml @@ -0,0 +1,30 @@ +# ghq +- name: setup ghq command + become: false + block: + - name: download binary + ansible.builtin.get_url: + url: https://github.com/x-motemen/ghq/releases/download/v1.8.0/ghq_linux_amd64.zip + dest: /tmp/ghq_linux_amd64.zip + + - name: unarchive ghq + ansible.builtin.unarchive: + src: /tmp/ghq_linux_amd64.zip + dest: /tmp/ + + - name: install binary + copy: + src: /tmp/ghq_linux_amd64/ghq + dest: "{{ lookup('env','HOME') }}/.local/bin/ghq" + mode: "0755" + + - name: install bash completion + copy: + src: /tmp/ghq_linux_amd64/misc/bash/_ghq + dest: "{{ lookup('env','HOME') }}/.local/share/bash-completion/completions/ghq" + mode: "0644" + + - name: install fish completion + ansible.builtin.shell: fisher install decors/fish-ghq + args: + executable: fish diff --git a/ansible/roles/dev_tools/tasks/install.yaml b/ansible/roles/dev_tools/tasks/install.yaml index 501e226..a47a9f0 100644 --- a/ansible/roles/dev_tools/tasks/install.yaml +++ b/ansible/roles/dev_tools/tasks/install.yaml @@ -26,3 +26,5 @@ - import_tasks: commands/emacs.yaml - import_tasks: commands/fish.yaml + +- import_tasks: commands/ghq.yaml diff --git a/ansible/roles/xdg_base_directory/tasks/main.yaml b/ansible/roles/xdg_base_directory/tasks/main.yaml index d317aa8..69ade63 100644 --- a/ansible/roles/xdg_base_directory/tasks/main.yaml +++ b/ansible/roles/xdg_base_directory/tasks/main.yaml @@ -8,7 +8,7 @@ - name: create local share dir become: false file: - path: "{{ lookup('env','HOME') }}/.local/share" + path: "{{ lookup('env','HOME') }}/.local/share/bash-completion/completions" state: directory mode: '0755'