Skip to content

Commit a094413

Browse files
committed
feat: add runner and workflow playbooks
Add two playbooks responsible for deploying GitHub runners and generating workflows for Kayobe automation. This commit also includes updated `requirements.yml` required by these playbooks.
1 parent 910dc74 commit a094413

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
- name: Deploy GitHub Runner
3+
hosts: github-runners
4+
become: yes
5+
roles:
6+
- role: geerlingguy.pip
7+
- role: geerlingguy.docker
8+
tasks:
9+
- name: Deploy runners
10+
ansible.builtin.include_role:
11+
role: monolithprojects.github_actions_runner
12+
vars:
13+
runner_name: "{{ ansible_facts.nodename }}-{{ runner.key }}"
14+
runner_dir: "{{ base_runner_dir }}/{{ runner.key }}"
15+
runner_labels: "{{ runner.value.labels | default(default_runner_labels) }}"
16+
runner_state: "{{ runner.value.state | default('started') }}"
17+
with_dict:
18+
"{{ github_runners }}"
19+
loop_control:
20+
loop_var: runner
21+
22+
- name: Ensure runner service is running
23+
ansible.builtin.service:
24+
name: actions.runner.{{ github_account }}-{{ github_repo }}.{{ ansible_facts.nodename }}-{{ runner.key }}.service
25+
state: started
26+
enabled: true
27+
become: true
28+
when: runner_state | default('started') == 'started'
29+
with_dict:
30+
"{{ github_runners }}"
31+
loop_control:
32+
loop_var: runner

etc/kayobe/ansible/requirements.yml

+8
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ collections:
66
version: 0.4.1
77
- name: stackhpc.hashicorp
88
version: 2.4.0
9+
- name: stackhpc.kayobe_workflows
10+
version: 1.0.1
911
roles:
1012
- src: stackhpc.vxlan
1113
- name: ansible-lockdown.rhel8_cis
@@ -14,3 +16,9 @@ roles:
1416
- name: wazuh-ansible
1517
src: https://github.com/stackhpc/wazuh-ansible
1618
version: stackhpc
19+
- name: geerlingguy.pip
20+
version: 2.2.0
21+
- name: monolithprojects.github_actions_runner
22+
version: 1.18.5
23+
- src: https://github.com/stackhpc/ansible-role-docker.git
24+
name: geerlingguy.docker
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
- name: Write Kayobe Automation Workflows for GitHub
3+
hosts: github-writer
4+
roles:
5+
- stackhpc.kayobe_workflows.github

0 commit comments

Comments
 (0)