Skip to content

2023.1: zed merge #919

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 24 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
9eab93a
Update RL9 host image to 9.3
MoteHue Jan 25, 2024
845328a
Update checkout github action to v4
Alex-Welsh Jan 29, 2024
94f91ec
Merge pull request #895 from stackhpc/rl9.3-overcloud-host-image
Alex-Welsh Jan 29, 2024
6c14370
Merge pull request #901 from stackhpc/update-checkout-action
Alex-Welsh Jan 30, 2024
21c9914
Update docs to point out admin port change
technowhizz Jan 31, 2024
e567738
fix wazuh docs formatting
sjpb Feb 1, 2024
39248f8
add wazuh keypaths for multiple environments to docs
sjpb Feb 1, 2024
8ed7c54
docs format nit
sjpb Feb 1, 2024
48e06bf
Merge pull request #907 from stackhpc/docs/wazuh
markgoddard Feb 2, 2024
6a2f89b
Zed: Rebuild Rocky Images
jovial Feb 2, 2024
60c0361
Merge remote-tracking branch 'origin/feature/zed/rocky9.3-kolla-image…
jovial Feb 2, 2024
d2e457d
Merge pull request #908 from stackhpc/feature/zed/rocky9.3-kolla-images
markgoddard Feb 5, 2024
97815eb
Merge pull request #911 from stackhpc/bugfix/zed/pulp-sync-fix
markgoddard Feb 5, 2024
e988956
Merge pull request #905 from stackhpc/zed-keystone-rgw
markgoddard Feb 5, 2024
f19ecd7
Switch to github hosted runners for host image promote
jovial Feb 7, 2024
6c83584
Fix release detection step
jovial Feb 7, 2024
7fecea9
Merge pull request #913 from stackhpc/ci/2023.1/github-runners
markgoddard Feb 7, 2024
6302be7
Add workflow to upload Ark host images to glance
Alex-Welsh Feb 7, 2024
25ebb3f
Only upload host images when required
Alex-Welsh Feb 7, 2024
0dfbb94
Merge pull request #912 from stackhpc/image-upload-workflow
markgoddard Feb 7, 2024
3727260
Merge stackhpc/yoga into stackhpc/zed
markgoddard Feb 7, 2024
a88f4ad
CI: Drop unsupported distributions from overcloud host image upload w…
markgoddard Feb 7, 2024
878e792
Merge stackhpc/zed into stackhpc/2023.1
markgoddard Feb 7, 2024
4f5cddd
CI: Automatically install correct version of OSC in image upload job
markgoddard Feb 7, 2024
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: 1 addition & 1 deletion .github/workflows/overcloud-host-image-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
rm -f /tmp/updated_images.txt

- name: Clone StackHPC Kayobe repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: stackhpc/kayobe
ref: refs/heads/stackhpc/${{ steps.openstack_release.outputs.openstack_release }}
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/overcloud-host-image-promote.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ jobs:
overcloud-host-image-promote:
name: Promote overcloud host image
if: github.repository == 'stackhpc/stackhpc-kayobe-config'
runs-on: [self-hosted, stackhpc-kayobe-config-kolla-builder-rl9]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
path: src/kayobe-config

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

- name: Clone StackHPC Kayobe repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: stackhpc/kayobe
ref: refs/heads/stackhpc/${{ steps.openstack_release.outputs.openstack_release }}
Expand Down
173 changes: 173 additions & 0 deletions .github/workflows/overcloud-host-image-upload.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
---
name: Upload overcloud host images
on:
workflow_dispatch:
inputs:
rocky9:
description: Upload Rocky Linux 9
type: boolean
default: true
ubuntu-jammy:
description: Upload Ubuntu 22.04 Jammy
type: boolean
default: true
kayobe-environment:
description: Kayobe environment to use
type: string
default: "ci-builder"
secrets:
KAYOBE_VAULT_PASSWORD:
required: true
CLOUDS_YAML:
required: true
OS_APPLICATION_CREDENTIAL_ID:
required: true
OS_APPLICATION_CREDENTIAL_SECRET:
required: true

env:
ANSIBLE_FORCE_COLOR: True
jobs:
overcloud-host-image-upload:
name: Upload overcloud host images
if: github.repository == 'stackhpc/stackhpc-kayobe-config'
runs-on: arc-skc-host-image-builder-runner
permissions: {}
steps:
- name: Install package dependencies
run: |
sudo apt update
sudo apt install -y build-essential git unzip nodejs python3-wheel python3-pip python3-venv

- uses: actions/checkout@v4
with:
path: src/kayobe-config

- name: Determine OpenStack release
id: openstack_release
run: |
BRANCH=$(awk -F'=' '/defaultbranch/ {print $2}' src/kayobe-config/.gitreview)
echo "openstack_release=${BRANCH}" | sed "s|stable/||" >> $GITHUB_OUTPUT

- name: Clone StackHPC Kayobe repository
uses: actions/checkout@v4
with:
repository: stackhpc/kayobe
ref: refs/heads/stackhpc/${{ steps.openstack_release.outputs.openstack_release }}
path: src/kayobe

- name: Install Kayobe
run: |
mkdir -p venvs &&
pushd venvs &&
python3 -m venv kayobe &&
source kayobe/bin/activate &&
pip install -U pip &&
pip install ../src/kayobe

- name: Bootstrap the control host
run: |
source venvs/kayobe/bin/activate &&
source src/kayobe-config/kayobe-env --environment ${{ inputs.kayobe-environment }} &&
kayobe control host bootstrap --skip-tags bootstrap

- name: Generate clouds.yaml
run: |
cat << EOF > clouds.yaml
${{ secrets.CLOUDS_YAML }}
EOF

- name: Install OpenStack client
run: |
source venvs/kayobe/bin/activate &&
pip install python-openstackclient -c https://opendev.org/openstack/requirements/raw/branch/stable/${{ steps.openstack_release.outputs.openstack_release }}/upper-constraints.txt

- name: Output Rocky Linux 9 image tag
id: rocky_9_image_tag
run: |
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

- name: Check if image exists already
id: rocky_9_image_exists
run: |
source venvs/kayobe/bin/activate &&
openstack image show \
overcloud-rocky-9-${{ steps.rocky_9_image_tag.outputs.image_tag }}
env:
OS_CLOUD: openstack
OS_APPLICATION_CREDENTIAL_ID: ${{ secrets.OS_APPLICATION_CREDENTIAL_ID }}
OS_APPLICATION_CREDENTIAL_SECRET: ${{ secrets.OS_APPLICATION_CREDENTIAL_SECRET }}
continue-on-error: true

- name: Download Rocky Linux 9 overcloud host image from Ark
run: |
source venvs/kayobe/bin/activate &&
source src/kayobe-config/kayobe-env --environment ${{ inputs.kayobe-environment }} &&
kayobe playbook run \
src/kayobe-config/etc/kayobe/ansible/pulp-host-image-download.yml \
-e os_distribution="rocky" \
-e os_release="9"
env:
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
if: inputs.rocky9 && steps.rocky_9_image_exists.outcome == 'failure'

- name: Upload Rocky Linux 9 overcloud host image to Cloud
run: |
source venvs/kayobe/bin/activate &&
openstack image create \
overcloud-rocky-9-${{ steps.rocky_9_image_tag.outputs.image_tag }} \
--container-format bare \
--disk-format qcow2 \
--file /tmp/rocky-9.qcow2 \
--private \
--progress
env:
OS_CLOUD: openstack
OS_APPLICATION_CREDENTIAL_ID: ${{ secrets.OS_APPLICATION_CREDENTIAL_ID }}
OS_APPLICATION_CREDENTIAL_SECRET: ${{ secrets.OS_APPLICATION_CREDENTIAL_SECRET }}
if: inputs.rocky9 && steps.rocky_9_image_exists.outcome == 'failure'

- name: Output Ubuntu Jammy image tag
id: ubuntu_jammy_image_tag
run: |
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

- name: Check if image exists already
id: ubuntu_jammy_image_exists
run: |
source venvs/kayobe/bin/activate &&
openstack image show \
overcloud-ubuntu-jammy-${{ steps.ubuntu_jammy_image_tag.outputs.image_tag }}
env:
OS_CLOUD: openstack
OS_APPLICATION_CREDENTIAL_ID: ${{ secrets.OS_APPLICATION_CREDENTIAL_ID }}
OS_APPLICATION_CREDENTIAL_SECRET: ${{ secrets.OS_APPLICATION_CREDENTIAL_SECRET }}
continue-on-error: true

- name: Download Ubuntu Jammy 22.04 overcloud host image from Ark
run: |
source venvs/kayobe/bin/activate &&
source src/kayobe-config/kayobe-env --environment ${{ inputs.kayobe-environment }} &&
kayobe playbook run \
src/kayobe-config/etc/kayobe/ansible/pulp-host-image-download.yml \
-e os_distribution="ubuntu" \
-e os_release="jammy"
env:
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
if: inputs.ubuntu-jammy && steps.ubuntu_jammy_image_exists.outcome == 'failure'

- name: Upload Ubuntu Jammy 22.04 overcloud host image to Cloud
run: |
source venvs/kayobe/bin/activate &&
openstack image create \
overcloud-ubuntu-jammy-${{ steps.ubuntu_jammy_image_tag.outputs.image_tag }} \
--container-format bare \
--disk-format qcow2 \
--file /tmp/ubuntu-jammy.qcow2 \
--private \
--progress
env:
OS_CLOUD: openstack
OS_APPLICATION_CREDENTIAL_ID: ${{ secrets.OS_APPLICATION_CREDENTIAL_ID }}
OS_APPLICATION_CREDENTIAL_SECRET: ${{ secrets.OS_APPLICATION_CREDENTIAL_SECRET }}
if: inputs.ubuntu-jammy && steps.ubuntu_jammy_image_exists.outcome == 'failure'
2 changes: 1 addition & 1 deletion .github/workflows/stackhpc-build-kayobe-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout kayobe config
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/stackhpc-container-image-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
openstack_release: ${{ steps.openstack_release.outputs.openstack_release }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Determine OpenStack release
id: openstack_release
Expand Down Expand Up @@ -97,12 +97,12 @@ jobs:
needs:
- generate-tag
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
path: src/kayobe-config

- name: Clone StackHPC Kayobe repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: stackhpc/kayobe
ref: refs/heads/stackhpc/${{ needs.generate-tag.outputs.openstack_release }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/stackhpc-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
aio: ${{ steps.changes.outputs.aio }}
steps:
- name: GitHub Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Check changed files
uses: dorny/paths-filter@v2
Expand All @@ -47,7 +47,7 @@ jobs:
if: github.repository == 'stackhpc/stackhpc-kayobe-config'
steps:
- name: GitHub Checkout 🛎
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python ${{ matrix.python-version }} 🐍
Expand Down
8 changes: 6 additions & 2 deletions doc/source/configuration/wazuh.rst
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,12 @@ You may need to modify some of the variables, including:

.. note::

NOTE:
If you are using multiple environments, and you need to customise Wazuh in
each environment, create override files in an appropriate directory,
for example `etc/kayobe/environments/production/inventory/group_vars/`
for example ``etc/kayobe/environments/production/inventory/group_vars/``.

Files which values can be overridden (in the context of Wazuh):

- etc/kayobe/inventory/group_vars/wazuh/wazuh-manager/wazuh-manager
- etc/kayobe/wazuh-manager.yml
- etc/kayobe/inventory/group_vars/wazuh/wazuh-agent/wazuh-agent
Expand Down Expand Up @@ -328,6 +329,9 @@ If you are using the wazuh generated certificates,
this will result in the creation of some certificates and keys (in case of custom certs adjust path to it).
Encrypt the keys (and remember to commit to git):

``ansible-vault encrypt --vault-password-file ~/vault.pass $KAYOBE_CONFIG_PATH/environments/<environment>/wazuh/wazuh-certificates/*.key``

If using the kayobe environments feature, otherwise:

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

Expand Down
38 changes: 38 additions & 0 deletions etc/kayobe/ansible/pulp-host-image-download.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
- name: Download an overcloud host image from Ark
hosts: localhost
vars:
# This var is an edited version of stackhpc_overcloud_host_image_url
# without the auth credentials in it. Auth is handled by username and
# password in the get_url task of this playbook
stackhpc_overcloud_host_image_url_no_auth: "{{ stackhpc_release_pulp_content_url }}/kayobe-images/\
{{ openstack_release }}/{{ os_distribution }}/{{ os_release }}/\
{{ 'ofed/' if stackhpc_overcloud_host_image_is_ofed else '' }}\
{{ stackhpc_overcloud_host_image_version }}/\
overcloud-{{ os_distribution }}-{{ os_release }}\
{{ '-ofed' if stackhpc_overcloud_host_image_is_ofed else '' }}.qcow2"

tasks:
- name: Print image information
debug:
msg: |
OS Distribution: {{ os_distribution }}
OS Release: {{ os_release }}
Image tag: {{ stackhpc_overcloud_host_image_version }}
OFED: {{ stackhpc_overcloud_host_image_is_ofed }}

# TODO: Add checksum support
- name: Download image artifact
get_url:
url: "{{ stackhpc_overcloud_host_image_url_no_auth }}"
username: "{{ stackhpc_image_repository_username }}"
password: "{{ stackhpc_image_repository_password }}"
force_basic_auth: true
unredirected_headers:
- "Authorization"
dest: "/tmp/{{ os_distribution }}-{{ os_release }}.qcow2"
mode: "0644"
register: image_download_result
until: image_download_result.status_code == 200
retries: 3
delay: 60