From 900e1223796993b8cf0af1dbe5d26717858065a4 Mon Sep 17 00:00:00 2001 From: Miguel Villa Floran Date: Sat, 18 May 2024 01:16:18 -0700 Subject: [PATCH] Add github cli install --- local.yml | 1 + tasks/gh-setup.yml | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 tasks/gh-setup.yml diff --git a/local.yml b/local.yml index b1d4287..3159aed 100644 --- a/local.yml +++ b/local.yml @@ -37,6 +37,7 @@ - include: tasks/gui-setup.yml - include: tasks/flatpak-setup.yml - include: tasks/discord-setup.yml + - include: tasks/gh-setup.yml - include: tasks/neovim-setup.yml - include: tasks/zsh-setup.yml # - include: tasks/dotfiles.yml diff --git a/tasks/gh-setup.yml b/tasks/gh-setup.yml new file mode 100644 index 0000000..467c491 --- /dev/null +++ b/tasks/gh-setup.yml @@ -0,0 +1,41 @@ +- name: Create keyring + become: true + ansible.builtin.shell: + cmd: "sudo mkdir -p -m 755 /etc/apt/keyrings" + tags: + - minimal-install + - install + - git-cli +- name: Download GitHub CLI + become: true + ansible.builtin.shell: + cmd: "wget -qO- https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null" + tags: + - minimal-install + - install + - git-cli +- name: Change git-cli keyring to read and execute for everyone + become: true + ansible.builtin.shell: + cmd: "chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg" + tags: + - minimal-install + - install + - git-cli +- name: git-cli + become: true + ansible.builtin.shell: + cmd: 'echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null' + tags: + - minimal-install + - install + - git-cli +- name: Install git cli + become: true + ansible.builtin.shell: + cmd: "sudo apt update && sudo apt install gh -y" + tags: + - minimal-install + - install + - git-cli +