feat(role): add GitHub CLI (gh)

Based on https:
//github.com/cli/cli/blob/19427d8819e36021c877b6e4cd855e060433f6ef/docs/install_linux.md.

Fixes: #28
This commit is contained in:
Oliver Davies 2022-04-05 18:58:02 +01:00
parent 3591a72612
commit 291a8df6d0
2 changed files with 27 additions and 0 deletions

View file

@ -8,6 +8,7 @@
- role: dconf
- role: docker
- role: fzf
- role: github-cli
- role: gnome-tweak-tools
- role: git
- role: htop

View file

@ -0,0 +1,26 @@
---
- name: Existing install
ansible.builtin.stat:
path: /usr/bin/gh
register: install
- name: Keyring
ansible.builtin.get_url:
dest: /usr/share/keyrings/githubcli-archive-keyring.gpg
mode: 644
url: https://cli.github.com/packages/githubcli-archive-keyring.gpg
when: not install.stat.exists
become: true
- name: Repository
ansible.builtin.apt_repository:
repo: "deb [arch=amd64 signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main"
when: not install.stat.exists
become: true
- name: Install
ansible.builtin.package:
name:
- gh
state: latest
become: true