Skip to content

Commit fca2540

Browse files
authored
Major: Create gh_install.yaml (#13)
* Create gh_install.yaml * Update github_runner.yaml
1 parent 0de0699 commit fca2540

2 files changed

Lines changed: 46 additions & 0 deletions

File tree

gh_install.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
- name: Install wget if not present
3+
apt:
4+
name: wget
5+
state: present
6+
when: ansible_facts.packages.wget is not defined
7+
8+
- name: Create /etc/apt/keyrings directory
9+
file:
10+
path: /etc/apt/keyrings
11+
state: directory
12+
mode: '0755'
13+
14+
- name: Download GitHub CLI archive keyring
15+
get_url:
16+
url: https://cli.github.com/packages/githubcli-archive-keyring.gpg
17+
dest: /tmp/githubcli-archive-keyring.gpg
18+
19+
- name: Copy GitHub CLI archive keyring to /etc/apt/keyrings
20+
copy:
21+
src: /tmp/githubcli-archive-keyring.gpg
22+
dest: /etc/apt/keyrings/githubcli-archive-keyring.gpg
23+
mode: '0644'
24+
25+
- name: Add GitHub CLI repository
26+
apt_repository:
27+
repo: "deb [arch={{ ansible_architecture }} signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main"
28+
state: present
29+
30+
- name: Update apt cache
31+
apt:
32+
update_cache: yes
33+
34+
- name: Install GitHub CLI
35+
apt:
36+
name: gh
37+
state: present

github_runner.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,15 @@
263263
- terraform
264264
tags:
265265
- always
266+
267+
- name: Include gh_install.yaml tasks
268+
ansible.builtin.include_tasks: gh_install.yaml
269+
args:
270+
apply:
271+
tags:
272+
- gh-install
273+
tags:
274+
- always
266275

267276
handlers:
268277
- name: Set correct permissions for sudoers file

0 commit comments

Comments
 (0)