Add gh role for macOS, Windows, and Debian

This commit is contained in:
Kenneth Benzie 2022-12-08 11:40:28 +00:00
parent 63ff47c3b2
commit 2abc38f696
6 changed files with 46 additions and 1 deletions

View File

@ -14,6 +14,7 @@
- role: bat
- role: curl
- role: fzf
- role: gh
- role: git
- role: htop
- role: jp

View File

@ -14,8 +14,9 @@
- role: bat
- role: curl
- role: fzf
- role: tree
- role: gh
- role: jq
- role: tree
- role: yq
- role: llvm

View File

@ -0,0 +1,5 @@
---
- name: install homebrew package
homebrew:
name: gh
state: latest

View File

@ -0,0 +1,31 @@
---
- set_fact:
arch_map:
aarch64: arm64
armv6l: armhf
armv7l: armhf
i386: i386
x86_64: amd64
- set_fact:
arch: '{{ [ansible_architecture] | map("extract", arch_map) | first }}'
- name: download apt repository key
become: true
get_url:
url: https://cli.github.com/packages/githubcli-archive-keyring.gpg
dest: /usr/share/keyrings/githubcli-archive-keyring.gpg
mode: 0644
- name: add apt repository list
become: true
apt_repository:
filename: github-cli
repo: 'deb [arch={{arch}} signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main'
state: present
- name: install apt package
become: true
apt:
name: gh
state: latest
update_cache: true

View File

@ -0,0 +1,5 @@
---
- name: install chocolatey package
win_chocolatey:
name: gh
state: latest

2
roles/gh/tasks/main.yaml Normal file
View File

@ -0,0 +1,2 @@
---
- include_tasks: '{{ansible_os_family}}.yaml'