Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions roles/github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ github_buildx_inline_config: |

`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`.

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`.

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`

`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:
Expand Down
32 changes: 32 additions & 0 deletions roles/github/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ github_buildx_enable_provenance: false

github_timeout: 360

github_default_octavia_certificates_expiry_time: 30

github_octavia_certificates_schedule:

github_tempest_test_suites: |
- default
- tempest-full
Expand Down Expand Up @@ -66,6 +70,17 @@ github_kayobe_environment_input: |
options: {{ github_kayobe_environments }}
{%- endif -%}

github_octavia_certificates_input: |
{%- if github_environment_selector == 'input' -%}
expiry_time:
description: |
Check if the Octavia Amphora certificates will expire within this
number of days (integer).
type: string
required: true
default: '{{ github_default_octavia_certificates_expiry_time }}'
{%- endif -%}

github_workflows:
- "{{ github_prepare_runner }}"
- "{{ github_build_kayobe_image }}"
Expand Down Expand Up @@ -131,6 +146,23 @@ github_run_infra_vm_service_deploy:
arguments: "{{ github_kayobe_task_arguments }}"
concurrency_group: infra

github_octavia_certificates_schedule_trigger:
schedule:
cron: "{{ github_octavia_certificates_schedule }}"

github_octavia_certificates_workflow_dispatch_trigger:
workflow_dispatch: "{{ github_octavia_certificates_input }}"

github_run_kolla_ansible_octavia_certificates:
file_name: run-kolla-ansible-octavia-certificates-check-expiry.yml
use_bespoke: true
expiry_time: "{{ github_default_octavia_certificates_expiry_time }}"
trigger: >-
{{ github_octavia_certificates_schedule_trigger if
github_octavia_certificates_schedule else
github_octavia_certificates_workflow_dispatch_trigger }}
concurrency_group: overcloud

github_run_network_connectivity_check:
file_name: run-network-connectivity-check.yml
trigger:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<%- if github_environment_selector == 'input' -%>
<%- set github_runs_on = github_runs_on + ['${{ inputs.kayobe_environment }}'] -%>
<%- set _ = workflow.update({"concurrency_group": "format('{0}-{1}', " + workflow.concurrency_group + ", '${{ inputs.kayobe_environment }}')" }) -%>
<%- set _ = github_default_registry.update({"url": "${{ vars[format('{0}_REGISTRY_URL', inputs.kayobe_environment)] }}" }) -%>
<%- set _ = github_default_registry.update({"username": "${{ vars[format('{0}_REGISTRY_USERNAME', inputs.kayobe_environment)] }}" }) -%>
<%- set _ = github_default_registry.update({"password": "${{ secrets[format('{0}_REGISTRY_PASSWORD', inputs.kayobe_environment)] }}" }) -%>
<%- set _ = github_default_kayobe_arguments.update({"KAYOBE_AUTOMATION_SSH_PRIVATE_KEY": "${{ secrets[format('{0}_KAYOBE_AUTOMATION_SSH_PRIVATE_KEY', inputs.kayobe_environment)] }}" }) -%>
<%- set _ = github_default_kayobe_arguments.update({"KAYOBE_VAULT_PASSWORD": "${{ secrets[format('{0}_KAYOBE_VAULT_PASSWORD', inputs.kayobe_environment)] }}" }) -%>
<%- set _ = github_kayobe_arguments.update({"KAYOBE_ENVIRONMENT": '${{ inputs.kayobe_environment }}'}) -%>
<%- endif -%>
<%- if github_environment_selector == 'single' -%>
<%- set _ = github_kayobe_arguments.update({"KAYOBE_ENVIRONMENT": github_kayobe_environments | first}) -%>
<%- endif -%>
%% lookup('template', 'header.yml.j2') %%
jobs:
prepare-runner:
uses: ./.github/workflows/prepare-runner.yml
%% format_file_name(workflow.file_name) %%:
runs-on: %% github_runs_on %%
permissions:
contents: read
packages: %% 'read' if (github_registry.url | default(github_default_registry.url)) == 'ghcr.io' else 'none' %%
pull-requests: none
container:
image: %% github_registry.url | default(github_default_registry.url) %%/%% github_image_name %%:%% github_image_tag %%
credentials:
username: %% github_registry.username | default(github_default_registry.username) %%
password: %% github_registry.password | default(github_default_registry.password) %%
concurrency:
group: %% workflow.concurrency_group %%
cancel-in-progress: false
timeout-minutes: %% github_timeout %%
needs: prepare-runner
steps:
<% if github_checkout_hook | length >= 1 %>
%% github_checkout_hook | indent(width=6, first=false) %%
<% endif %>
- name: Checkout kayobe config
uses: actions/checkout@v3
with:
submodules: true
path: kayobe-config

<% if github_kayobe_hook | length >= 1 %>
%% github_kayobe_hook | indent(width=6, first=false) %%
<% endif %>
- name: Symlink source checkout to expected location
run: sudo ln -s $PWD/kayobe-config /src

- name: Generate Kolla Ansible configuration
run: |
/src/.automation/pipeline/overcloud-service-configuration-generate.sh "/tmp/ignore"
env:
<% if github_environment_selector is not none %>
KAYOBE_ENVIRONMENT: '%% github_kayobe_arguments.KAYOBE_ENVIRONMENT %%'
<% endif %>
HOME: '%% github_kayobe_arguments.HOME | default(github_default_kayobe_arguments.HOME) %%'
KOLLA_TAGS: none

- name: Check Octavia certificates expiry
run: |
/src/.automation/pipeline/kolla-ansible-run.sh "octavia-certificates --check-expiry <%- if github_octavia_certificates_schedule %> %% workflow.expiry_time %% <%- else %> ${{ inputs.expiry_time }} <%- endif -%>"
env:
<% if github_environment_selector is not none %>
KAYOBE_ENVIRONMENT: '%% github_kayobe_arguments.KAYOBE_ENVIRONMENT %%'
<% endif %>
KAYOBE_AUTOMATION_SSH_PRIVATE_KEY: "%% github_kayobe_arguments.KAYOBE_AUTOMATION_SSH_PRIVATE_KEY | default(github_default_kayobe_arguments.KAYOBE_AUTOMATION_SSH_PRIVATE_KEY) %%"
KAYOBE_VAULT_PASSWORD: "%% github_kayobe_arguments.KAYOBE_VAULT_PASSWORD | default(github_default_kayobe_arguments.KAYOBE_VAULT_PASSWORD) %%"
HOME: '%% github_kayobe_arguments.HOME | default(github_default_kayobe_arguments.HOME) %%'
<% if github_final_hook | length >= 1 +%>
%% github_final_hook | indent(width=6, first=false) -%%
<% endif %>