Skip to content

Commit 91c0dca

Browse files
committed
Add workflow for checking Octavia cert expiry
1 parent 072c57a commit 91c0dca

File tree

2 files changed

+84
-0
lines changed

2 files changed

+84
-0
lines changed

roles/github/defaults/main.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ github_buildx_enable_provenance: false
3131

3232
github_timeout: 360
3333

34+
github_octavia_certificates_expiry_time: 30
35+
3436
github_tempest_test_suites: |
3537
- default
3638
- tempest-full
@@ -74,6 +76,7 @@ github_workflows:
7476
- "{{ github_run_infra_vm_host_package_update }}"
7577
- "{{ github_run_infra_vm_provision }}"
7678
- "{{ github_run_infra_vm_service_deploy }}"
79+
- "{{ github_run_kolla_ansible_octavia_certificates }}"
7780
- "{{ github_run_network_connectivity_check }}"
7881
- "{{ github_run_overcloud_container_image_pull }}"
7982
- "{{ github_run_overcloud_database_backup }}"
@@ -131,6 +134,15 @@ github_run_infra_vm_service_deploy:
131134
arguments: "{{ github_kayobe_task_arguments }}"
132135
concurrency_group: infra
133136

137+
github_run_kolla_ansible_octavia_certificates:
138+
file_name: run-kolla-ansible-octavia-certificates-check-expiry.yml
139+
use_bespoke: true
140+
expiry_time: "{{ github_octavia_certificates_expiry_time }}"
141+
trigger:
142+
workflow_dispatch: "{{ github_kayobe_dispatch_inputs }}"
143+
arguments: "{{ github_kayobe_task_arguments }}"
144+
concurrency_group: overcloud
145+
134146
github_run_network_connectivity_check:
135147
file_name: run-network-connectivity-check.yml
136148
trigger:
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<%- if github_environment_selector == 'input' -%>
2+
<%- set github_runs_on = github_runs_on + ['${{ inputs.kayobe_environment }}'] -%>
3+
<%- set _ = workflow.update({"concurrency_group": "format('{0}-{1}', " + workflow.concurrency_group + ", '${{ inputs.kayobe_environment }}')" }) -%>
4+
<%- set _ = github_default_registry.update({"url": "${{ vars[format('{0}_REGISTRY_URL', inputs.kayobe_environment)] }}" }) -%>
5+
<%- set _ = github_default_registry.update({"username": "${{ vars[format('{0}_REGISTRY_USERNAME', inputs.kayobe_environment)] }}" }) -%>
6+
<%- set _ = github_default_registry.update({"password": "${{ secrets[format('{0}_REGISTRY_PASSWORD', inputs.kayobe_environment)] }}" }) -%>
7+
<%- set _ = github_default_kayobe_arguments.update({"KAYOBE_AUTOMATION_SSH_PRIVATE_KEY": "${{ secrets[format('{0}_KAYOBE_AUTOMATION_SSH_PRIVATE_KEY', inputs.kayobe_environment)] }}" }) -%>
8+
<%- set _ = github_default_kayobe_arguments.update({"KAYOBE_VAULT_PASSWORD": "${{ secrets[format('{0}_KAYOBE_VAULT_PASSWORD', inputs.kayobe_environment)] }}" }) -%>
9+
<%- set _ = github_kayobe_arguments.update({"KAYOBE_ENVIRONMENT": '${{ inputs.kayobe_environment }}'}) -%>
10+
<%- endif -%>
11+
<%- if github_environment_selector == 'single' -%>
12+
<%- set _ = github_kayobe_arguments.update({"KAYOBE_ENVIRONMENT": github_kayobe_environments | first}) -%>
13+
<%- endif -%>
14+
%% lookup('template', 'header.yml.j2') %%
15+
jobs:
16+
prepare-runner:
17+
uses: ./.github/workflows/prepare-runner.yml
18+
%% format_file_name(workflow.file_name) %%:
19+
runs-on: %% github_runs_on %%
20+
permissions:
21+
contents: read
22+
packages: %% 'read' if (github_registry.url | default(github_default_registry.url)) == 'ghcr.io' else 'none' %%
23+
pull-requests: none
24+
container:
25+
image: %% github_registry.url | default(github_default_registry.url) %%/%% github_image_name %%:%% github_image_tag %%
26+
credentials:
27+
username: %% github_registry.username | default(github_default_registry.username) %%
28+
password: %% github_registry.password | default(github_default_registry.password) %%
29+
concurrency:
30+
group: %% workflow.concurrency_group %%
31+
cancel-in-progress: false
32+
timeout-minutes: %% github_timeout %%
33+
needs: prepare-runner
34+
steps:
35+
<% if github_checkout_hook | length >= 1 %>
36+
%% github_checkout_hook | indent(width=6, first=false) %%
37+
<% endif %>
38+
- name: Checkout kayobe config
39+
uses: actions/checkout@v3
40+
with:
41+
submodules: true
42+
path: kayobe-config
43+
44+
<% if github_kayobe_hook | length >= 1 %>
45+
%% github_kayobe_hook | indent(width=6, first=false) %%
46+
<% endif %>
47+
- name: Symlink source checkout to expected location
48+
run: sudo ln -s $PWD/kayobe-config /src
49+
50+
- name: Generate Kolla Ansible configuration
51+
run: |
52+
/src/.automation/pipeline/overcloud-service-configuration-generate.sh "/tmp/ignore"
53+
env:
54+
<% if github_environment_selector is not none %>
55+
KAYOBE_ENVIRONMENT: '%% github_kayobe_arguments.KAYOBE_ENVIRONMENT %%'
56+
<% endif %>
57+
HOME: '%% github_kayobe_arguments.HOME | default(github_default_kayobe_arguments.HOME) %%'
58+
KOLLA_TAGS: none
59+
60+
- name: Check Octavia certificates expiry
61+
run: |
62+
/src/.automation/pipeline/kolla-ansible-run.sh "octavia-certificates --check-expiry %% workflow.expiry_time %%"
63+
env:
64+
<% if github_environment_selector is not none %>
65+
KAYOBE_ENVIRONMENT: '%% github_kayobe_arguments.KAYOBE_ENVIRONMENT %%'
66+
<% endif %>
67+
KAYOBE_AUTOMATION_SSH_PRIVATE_KEY: "%% github_kayobe_arguments.KAYOBE_AUTOMATION_SSH_PRIVATE_KEY | default(github_default_kayobe_arguments.KAYOBE_AUTOMATION_SSH_PRIVATE_KEY) %%"
68+
KAYOBE_VAULT_PASSWORD: "%% github_kayobe_arguments.KAYOBE_VAULT_PASSWORD | default(github_default_kayobe_arguments.KAYOBE_VAULT_PASSWORD) %%"
69+
HOME: '%% github_kayobe_arguments.HOME | default(github_default_kayobe_arguments.HOME) %%'
70+
<% if github_final_hook | length >= 1 +%>
71+
%% github_final_hook | indent(width=6, first=false) -%%
72+
<% endif %>

0 commit comments

Comments
 (0)