Skip to content

Commit 2fb52e5

Browse files
authored
Add secret store unseal playbook for action runners (#1969)
When CI action runners are rebooted, their secret store needs to be unsealed. Added unsealing playbook for them.
1 parent e0d1d6d commit 2fb52e5

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
- name: Unseal secret store on the ci-runners
3+
any_errors_fatal: true
4+
gather_facts: true
5+
hosts: github-runners:gitlab-runners
6+
vars:
7+
vault_api_addr: http://127.0.0.1:8200
8+
tasks:
9+
- name: Set a fact about the virtualenv on the remote system
10+
ansible.builtin.set_fact:
11+
virtualenv: "{{ ansible_python_interpreter | dirname | dirname }}"
12+
when:
13+
- ansible_python_interpreter is defined
14+
- not ansible_python_interpreter.startswith('/bin/')
15+
- not ansible_python_interpreter.startswith('/usr/bin/')
16+
17+
- name: Ensure Python hvac module is installed
18+
ansible.builtin.pip:
19+
name: hvac
20+
state: latest
21+
extra_args: "{% if pip_upper_constraints_file %}-c {{ pip_upper_constraints_file }}{% endif %}"
22+
virtualenv: "{{ virtualenv is defined | ternary(virtualenv, omit) }}"
23+
become: "{{ virtualenv is not defined }}"
24+
25+
- name: Include secret store keys
26+
ansible.builtin.include_vars:
27+
file: "{{ kayobe_env_config_path }}/{{ stackhpc_ca_secret_store }}/kayobe-automation-keys.json"
28+
name: secret_store_keys
29+
30+
- name: Apply unseal role
31+
ansible.builtin.import_role:
32+
name: stackhpc.hashicorp.vault_unseal
33+
vars:
34+
vault_unseal_keys: "{{ secret_store_keys.keys_base64 }}"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
features:
3+
- |
4+
Added a playbook for unsealing secret store deployed at CI runners (Hosts
5+
in github-runners or gitlab-runners inventory group).
6+
To run CI after rebooting CI runners, secret store needs to be unsealed
7+
using this playbook.

0 commit comments

Comments
 (0)