-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgh_install.yaml
More file actions
38 lines (32 loc) · 1009 Bytes
/
gh_install.yaml
File metadata and controls
38 lines (32 loc) · 1009 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
---
- name: Install wget if not present
apt:
name: wget
state: present
when: ansible_facts.packages.wget is not defined
- name: Create /etc/apt/keyrings directory
file:
path: /etc/apt/keyrings
state: directory
mode: '0755'
- name: Download GitHub CLI archive keyring
ansible.builtin.get_url:
url: https://cli.github.com/packages/githubcli-archive-keyring.gpg
dest: /tmp/githubcli-archive-keyring.gpg
- name: Copy GitHub CLI archive keyring to /etc/apt/keyrings
ansible.builtin.copy:
src: /tmp/githubcli-archive-keyring.gpg
dest: /etc/apt/keyrings/githubcli-archive-keyring.gpg
remote_src: yes
mode: '0644'
- name: Add GitHub CLI repository
apt_repository:
repo: "deb [arch={{ ansible_architecture }} signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main"
state: present
- name: Update apt cache
apt:
update_cache: yes
- name: Install GitHub CLI
apt:
name: gh
state: present