Skip to content

Commit 988463f

Browse files
committed
Also include support for cron scheduling
1 parent 322a01b commit 988463f

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

roles/github/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ github_buildx_inline_config: |
7171

7272
`github_tempest_test_suites`: provide a list of load lists to be made available within the drop-down list for running tempest. Defaults to `default` and `tempest-full`.
7373

74+
If you are using the workflow `github_run_kolla_ansible_octavia_certificates` to check for the expiry of Octavia Amphora certificates, by default it will allow for manual execution via workflow_dispatch. You can change this to run automatically on a schedule by setting `github_octavia_certificates_schedule` to a cron schedule. If you want to change the number of days checked, set the variable `github_default_octavia_certificates_expiry_time`.
75+
7476
If you wish to make more impactful changes such as which workflows are built and what they contain then see the list of dictionaries called `workflows` in `defaults/main.yml`
7577

7678
`github_workflows:` is a list of dictionaries that contains each of the workflows described above. A given list element is made up of the following:

roles/github/defaults/main.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ github_buildx_enable_provenance: false
3131

3232
github_timeout: 360
3333

34-
github_octavia_certificates_expiry_time: 30
34+
github_default_octavia_certificates_expiry_time: 30
35+
36+
github_octavia_certificates_schedule:
3537

3638
github_tempest_test_suites: |
3739
- default
@@ -68,15 +70,15 @@ github_kayobe_environment_input: |
6870
options: {{ github_kayobe_environments }}
6971
{%- endif -%}
7072
71-
github_octavia_certificates_expiry_time_input: |
73+
github_octavia_certificates_input: |
7274
{%- if github_environment_selector == 'input' -%}
7375
expiry_time:
7476
description: |
7577
Check if the Octavia Amphora certificates will expire within this
7678
number of days (integer).
7779
type: string
7880
required: true
79-
default: '{{ github_octavia_certificates_expiry_time }}'
81+
default: '{{ github_default_octavia_certificates_expiry_time }}'
8082
{%- endif -%}
8183
8284
github_workflows:
@@ -87,7 +89,6 @@ github_workflows:
8789
- "{{ github_run_infra_vm_host_package_update }}"
8890
- "{{ github_run_infra_vm_provision }}"
8991
- "{{ github_run_infra_vm_service_deploy }}"
90-
- "{{ github_run_kolla_ansible_octavia_certificates }}"
9192
- "{{ github_run_network_connectivity_check }}"
9293
- "{{ github_run_overcloud_container_image_pull }}"
9394
- "{{ github_run_overcloud_database_backup }}"
@@ -145,12 +146,18 @@ github_run_infra_vm_service_deploy:
145146
arguments: "{{ github_kayobe_task_arguments }}"
146147
concurrency_group: infra
147148

149+
github_octavia_certificates_schedule_trigger:
150+
schedule:
151+
cron: "{{ github_octavia_certificates_schedule }}"
152+
153+
github_octavia_certificates_workflow_dispatch_trigger:
154+
workflow_dispatch: "{{ github_octavia_certificates_input }}"
155+
148156
github_run_kolla_ansible_octavia_certificates:
149157
file_name: run-kolla-ansible-octavia-certificates-check-expiry.yml
150158
use_bespoke: true
151-
expiry_time: "{{ github_octavia_certificates_expiry_time }}"
152-
trigger:
153-
workflow_dispatch: "{{ github_octavia_certificates_expiry_time_input }}"
159+
expiry_time: "{{ github_default_octavia_certificates_expiry_time }}"
160+
trigger: "{{ github_octavia_certificates_schedule_trigger if github_octavia_certificates_schedule else github_octavia_certificates_workflow_dispatch_trigger }}"
154161
concurrency_group: overcloud
155162

156163
github_run_network_connectivity_check:

roles/github/templates/run-kolla-ansible-octavia-certificates-check-expiry.yml.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959

6060
- name: Check Octavia certificates expiry
6161
run: |
62-
/src/.automation/pipeline/kolla-ansible-run.sh "octavia-certificates --check-expiry %% workflow.expiry_time %%"
62+
/src/.automation/pipeline/kolla-ansible-run.sh "octavia-certificates --check-expiry <%- if github_octavia_certificates_schedule %> %% workflow.expiry_time %% <%- else %> ${{ inputs.expiry_time }} <%- endif -%>"
6363
env:
6464
<% if github_environment_selector is not none %>
6565
KAYOBE_ENVIRONMENT: '%% github_kayobe_arguments.KAYOBE_ENVIRONMENT %%'

0 commit comments

Comments
 (0)