Oliver Davies
291a8df6d0
Based on https: //github.com/cli/cli/blob/19427d8819e36021c877b6e4cd855e060433f6ef/docs/install_linux.md. Fixes: #28
27 lines
663 B
YAML
27 lines
663 B
YAML
---
|
|
- 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
|