Skip to content

Commit 05d32d4

Browse files
authored
Merge pull request #919 from stackhpc/2023.1-zed-merge
2023.1: zed merge
2 parents 18da209 + 4f5cddd commit 05d32d4

File tree

8 files changed

+228
-12
lines changed

8 files changed

+228
-12
lines changed

.github/workflows/overcloud-host-image-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
rm -f /tmp/updated_images.txt
5656
5757
- name: Clone StackHPC Kayobe repository
58-
uses: actions/checkout@v3
58+
uses: actions/checkout@v4
5959
with:
6060
repository: stackhpc/kayobe
6161
ref: refs/heads/stackhpc/${{ steps.openstack_release.outputs.openstack_release }}

.github/workflows/overcloud-host-image-promote.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ jobs:
2121
overcloud-host-image-promote:
2222
name: Promote overcloud host image
2323
if: github.repository == 'stackhpc/stackhpc-kayobe-config'
24-
runs-on: [self-hosted, stackhpc-kayobe-config-kolla-builder-rl9]
24+
runs-on: ubuntu-22.04
2525
steps:
26-
- uses: actions/checkout@v3
26+
- uses: actions/checkout@v4
2727
with:
2828
path: src/kayobe-config
2929

@@ -32,9 +32,10 @@ jobs:
3232
run: |
3333
BRANCH=$(awk -F'=' '/defaultbranch/ {print $2}' .gitreview)
3434
echo "openstack_release=${BRANCH}" | sed "s|stable/||" >> $GITHUB_OUTPUT
35+
working-directory: src/kayobe-config
3536

3637
- name: Clone StackHPC Kayobe repository
37-
uses: actions/checkout@v3
38+
uses: actions/checkout@v4
3839
with:
3940
repository: stackhpc/kayobe
4041
ref: refs/heads/stackhpc/${{ steps.openstack_release.outputs.openstack_release }}
Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
---
2+
name: Upload overcloud host images
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
rocky9:
7+
description: Upload Rocky Linux 9
8+
type: boolean
9+
default: true
10+
ubuntu-jammy:
11+
description: Upload Ubuntu 22.04 Jammy
12+
type: boolean
13+
default: true
14+
kayobe-environment:
15+
description: Kayobe environment to use
16+
type: string
17+
default: "ci-builder"
18+
secrets:
19+
KAYOBE_VAULT_PASSWORD:
20+
required: true
21+
CLOUDS_YAML:
22+
required: true
23+
OS_APPLICATION_CREDENTIAL_ID:
24+
required: true
25+
OS_APPLICATION_CREDENTIAL_SECRET:
26+
required: true
27+
28+
env:
29+
ANSIBLE_FORCE_COLOR: True
30+
jobs:
31+
overcloud-host-image-upload:
32+
name: Upload overcloud host images
33+
if: github.repository == 'stackhpc/stackhpc-kayobe-config'
34+
runs-on: arc-skc-host-image-builder-runner
35+
permissions: {}
36+
steps:
37+
- name: Install package dependencies
38+
run: |
39+
sudo apt update
40+
sudo apt install -y build-essential git unzip nodejs python3-wheel python3-pip python3-venv
41+
42+
- uses: actions/checkout@v4
43+
with:
44+
path: src/kayobe-config
45+
46+
- name: Determine OpenStack release
47+
id: openstack_release
48+
run: |
49+
BRANCH=$(awk -F'=' '/defaultbranch/ {print $2}' src/kayobe-config/.gitreview)
50+
echo "openstack_release=${BRANCH}" | sed "s|stable/||" >> $GITHUB_OUTPUT
51+
52+
- name: Clone StackHPC Kayobe repository
53+
uses: actions/checkout@v4
54+
with:
55+
repository: stackhpc/kayobe
56+
ref: refs/heads/stackhpc/${{ steps.openstack_release.outputs.openstack_release }}
57+
path: src/kayobe
58+
59+
- name: Install Kayobe
60+
run: |
61+
mkdir -p venvs &&
62+
pushd venvs &&
63+
python3 -m venv kayobe &&
64+
source kayobe/bin/activate &&
65+
pip install -U pip &&
66+
pip install ../src/kayobe
67+
68+
- name: Bootstrap the control host
69+
run: |
70+
source venvs/kayobe/bin/activate &&
71+
source src/kayobe-config/kayobe-env --environment ${{ inputs.kayobe-environment }} &&
72+
kayobe control host bootstrap --skip-tags bootstrap
73+
74+
- name: Generate clouds.yaml
75+
run: |
76+
cat << EOF > clouds.yaml
77+
${{ secrets.CLOUDS_YAML }}
78+
EOF
79+
80+
- name: Install OpenStack client
81+
run: |
82+
source venvs/kayobe/bin/activate &&
83+
pip install python-openstackclient -c https://opendev.org/openstack/requirements/raw/branch/stable/${{ steps.openstack_release.outputs.openstack_release }}/upper-constraints.txt
84+
85+
- name: Output Rocky Linux 9 image tag
86+
id: rocky_9_image_tag
87+
run: |
88+
echo image_tag=$(grep stackhpc_rocky_9_overcloud_host_image_version: src/kayobe-config/etc/kayobe/pulp-host-image-versions.yml | awk '{print $2}') >> $GITHUB_OUTPUT
89+
90+
- name: Check if image exists already
91+
id: rocky_9_image_exists
92+
run: |
93+
source venvs/kayobe/bin/activate &&
94+
openstack image show \
95+
overcloud-rocky-9-${{ steps.rocky_9_image_tag.outputs.image_tag }}
96+
env:
97+
OS_CLOUD: openstack
98+
OS_APPLICATION_CREDENTIAL_ID: ${{ secrets.OS_APPLICATION_CREDENTIAL_ID }}
99+
OS_APPLICATION_CREDENTIAL_SECRET: ${{ secrets.OS_APPLICATION_CREDENTIAL_SECRET }}
100+
continue-on-error: true
101+
102+
- name: Download Rocky Linux 9 overcloud host image from Ark
103+
run: |
104+
source venvs/kayobe/bin/activate &&
105+
source src/kayobe-config/kayobe-env --environment ${{ inputs.kayobe-environment }} &&
106+
kayobe playbook run \
107+
src/kayobe-config/etc/kayobe/ansible/pulp-host-image-download.yml \
108+
-e os_distribution="rocky" \
109+
-e os_release="9"
110+
env:
111+
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
112+
if: inputs.rocky9 && steps.rocky_9_image_exists.outcome == 'failure'
113+
114+
- name: Upload Rocky Linux 9 overcloud host image to Cloud
115+
run: |
116+
source venvs/kayobe/bin/activate &&
117+
openstack image create \
118+
overcloud-rocky-9-${{ steps.rocky_9_image_tag.outputs.image_tag }} \
119+
--container-format bare \
120+
--disk-format qcow2 \
121+
--file /tmp/rocky-9.qcow2 \
122+
--private \
123+
--progress
124+
env:
125+
OS_CLOUD: openstack
126+
OS_APPLICATION_CREDENTIAL_ID: ${{ secrets.OS_APPLICATION_CREDENTIAL_ID }}
127+
OS_APPLICATION_CREDENTIAL_SECRET: ${{ secrets.OS_APPLICATION_CREDENTIAL_SECRET }}
128+
if: inputs.rocky9 && steps.rocky_9_image_exists.outcome == 'failure'
129+
130+
- name: Output Ubuntu Jammy image tag
131+
id: ubuntu_jammy_image_tag
132+
run: |
133+
echo image_tag=$(grep stackhpc_ubuntu_jammy_overcloud_host_image_version: src/kayobe-config/etc/kayobe/pulp-host-image-versions.yml | awk '{print $2}') >> $GITHUB_OUTPUT
134+
135+
- name: Check if image exists already
136+
id: ubuntu_jammy_image_exists
137+
run: |
138+
source venvs/kayobe/bin/activate &&
139+
openstack image show \
140+
overcloud-ubuntu-jammy-${{ steps.ubuntu_jammy_image_tag.outputs.image_tag }}
141+
env:
142+
OS_CLOUD: openstack
143+
OS_APPLICATION_CREDENTIAL_ID: ${{ secrets.OS_APPLICATION_CREDENTIAL_ID }}
144+
OS_APPLICATION_CREDENTIAL_SECRET: ${{ secrets.OS_APPLICATION_CREDENTIAL_SECRET }}
145+
continue-on-error: true
146+
147+
- name: Download Ubuntu Jammy 22.04 overcloud host image from Ark
148+
run: |
149+
source venvs/kayobe/bin/activate &&
150+
source src/kayobe-config/kayobe-env --environment ${{ inputs.kayobe-environment }} &&
151+
kayobe playbook run \
152+
src/kayobe-config/etc/kayobe/ansible/pulp-host-image-download.yml \
153+
-e os_distribution="ubuntu" \
154+
-e os_release="jammy"
155+
env:
156+
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
157+
if: inputs.ubuntu-jammy && steps.ubuntu_jammy_image_exists.outcome == 'failure'
158+
159+
- name: Upload Ubuntu Jammy 22.04 overcloud host image to Cloud
160+
run: |
161+
source venvs/kayobe/bin/activate &&
162+
openstack image create \
163+
overcloud-ubuntu-jammy-${{ steps.ubuntu_jammy_image_tag.outputs.image_tag }} \
164+
--container-format bare \
165+
--disk-format qcow2 \
166+
--file /tmp/ubuntu-jammy.qcow2 \
167+
--private \
168+
--progress
169+
env:
170+
OS_CLOUD: openstack
171+
OS_APPLICATION_CREDENTIAL_ID: ${{ secrets.OS_APPLICATION_CREDENTIAL_ID }}
172+
OS_APPLICATION_CREDENTIAL_SECRET: ${{ secrets.OS_APPLICATION_CREDENTIAL_SECRET }}
173+
if: inputs.ubuntu-jammy && steps.ubuntu_jammy_image_exists.outcome == 'failure'

.github/workflows/stackhpc-build-kayobe-image.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
steps:
5252
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
5353
- name: Checkout kayobe config
54-
uses: actions/checkout@v3
54+
uses: actions/checkout@v4
5555
with:
5656
submodules: true
5757

.github/workflows/stackhpc-container-image-build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
openstack_release: ${{ steps.openstack_release.outputs.openstack_release }}
4949
steps:
5050
- name: Checkout
51-
uses: actions/checkout@v3
51+
uses: actions/checkout@v4
5252

5353
- name: Determine OpenStack release
5454
id: openstack_release
@@ -97,12 +97,12 @@ jobs:
9797
needs:
9898
- generate-tag
9999
steps:
100-
- uses: actions/checkout@v3
100+
- uses: actions/checkout@v4
101101
with:
102102
path: src/kayobe-config
103103

104104
- name: Clone StackHPC Kayobe repository
105-
uses: actions/checkout@v3
105+
uses: actions/checkout@v4
106106
with:
107107
repository: stackhpc/kayobe
108108
ref: refs/heads/stackhpc/${{ needs.generate-tag.outputs.openstack_release }}

.github/workflows/stackhpc-pull-request.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
aio: ${{ steps.changes.outputs.aio }}
2323
steps:
2424
- name: GitHub Checkout
25-
uses: actions/checkout@v3
25+
uses: actions/checkout@v4
2626

2727
- name: Check changed files
2828
uses: dorny/paths-filter@v2
@@ -47,7 +47,7 @@ jobs:
4747
if: github.repository == 'stackhpc/stackhpc-kayobe-config'
4848
steps:
4949
- name: GitHub Checkout 🛎
50-
uses: actions/checkout@v3
50+
uses: actions/checkout@v4
5151
with:
5252
fetch-depth: 0
5353
- name: Setup Python ${{ matrix.python-version }} 🐍

doc/source/configuration/wazuh.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,11 +226,12 @@ You may need to modify some of the variables, including:
226226

227227
.. note::
228228

229-
NOTE:
230229
If you are using multiple environments, and you need to customise Wazuh in
231230
each environment, create override files in an appropriate directory,
232-
for example `etc/kayobe/environments/production/inventory/group_vars/`
231+
for example ``etc/kayobe/environments/production/inventory/group_vars/``.
232+
233233
Files which values can be overridden (in the context of Wazuh):
234+
234235
- etc/kayobe/inventory/group_vars/wazuh/wazuh-manager/wazuh-manager
235236
- etc/kayobe/wazuh-manager.yml
236237
- etc/kayobe/inventory/group_vars/wazuh/wazuh-agent/wazuh-agent
@@ -328,6 +329,9 @@ If you are using the wazuh generated certificates,
328329
this will result in the creation of some certificates and keys (in case of custom certs adjust path to it).
329330
Encrypt the keys (and remember to commit to git):
330331

332+
``ansible-vault encrypt --vault-password-file ~/vault.pass $KAYOBE_CONFIG_PATH/environments/<environment>/wazuh/wazuh-certificates/*.key``
333+
334+
If using the kayobe environments feature, otherwise:
331335

332336
``ansible-vault encrypt --vault-password-file ~/vault.pass $KAYOBE_CONFIG_PATH/ansible/wazuh/certificates/certs/*.key``
333337

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
- name: Download an overcloud host image from Ark
3+
hosts: localhost
4+
vars:
5+
# This var is an edited version of stackhpc_overcloud_host_image_url
6+
# without the auth credentials in it. Auth is handled by username and
7+
# password in the get_url task of this playbook
8+
stackhpc_overcloud_host_image_url_no_auth: "{{ stackhpc_release_pulp_content_url }}/kayobe-images/\
9+
{{ openstack_release }}/{{ os_distribution }}/{{ os_release }}/\
10+
{{ 'ofed/' if stackhpc_overcloud_host_image_is_ofed else '' }}\
11+
{{ stackhpc_overcloud_host_image_version }}/\
12+
overcloud-{{ os_distribution }}-{{ os_release }}\
13+
{{ '-ofed' if stackhpc_overcloud_host_image_is_ofed else '' }}.qcow2"
14+
15+
tasks:
16+
- name: Print image information
17+
debug:
18+
msg: |
19+
OS Distribution: {{ os_distribution }}
20+
OS Release: {{ os_release }}
21+
Image tag: {{ stackhpc_overcloud_host_image_version }}
22+
OFED: {{ stackhpc_overcloud_host_image_is_ofed }}
23+
24+
# TODO: Add checksum support
25+
- name: Download image artifact
26+
get_url:
27+
url: "{{ stackhpc_overcloud_host_image_url_no_auth }}"
28+
username: "{{ stackhpc_image_repository_username }}"
29+
password: "{{ stackhpc_image_repository_password }}"
30+
force_basic_auth: true
31+
unredirected_headers:
32+
- "Authorization"
33+
dest: "/tmp/{{ os_distribution }}-{{ os_release }}.qcow2"
34+
mode: "0644"
35+
register: image_download_result
36+
until: image_download_result.status_code == 200
37+
retries: 3
38+
delay: 60

0 commit comments

Comments
 (0)