Skip to content

Commit

Permalink
Testo 2 - post-review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-Welsh committed Mar 28, 2024
1 parent edb40bf commit 9fb349f
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 41 deletions.
10 changes: 0 additions & 10 deletions .github/workflows/overcloud-host-image-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,28 +185,19 @@ jobs:
cat src/kayobe-config/terraform/host-image-builder/id_rsa.pub >> ~/.ssh/authorized_keys
cp src/kayobe-config/terraform/host-image-builder/id_rsa* ~/.ssh/
- name: Update inventory
run: |
cat > src/kayobe-config/etc/kayobe/environments/ci-builder/inventory/hosts << EOF
[seed]
builder
EOF
- name: Bootstrap the control host
run: |
source venvs/kayobe/bin/activate &&
source src/kayobe-config/kayobe-env --environment ci-builder &&
kayobe control host bootstrap
- name: Configure the seed host (Builder VM)
continue-on-error: true
run: |
source venvs/kayobe/bin/activate &&
source src/kayobe-config/kayobe-env --environment ci-builder &&
kayobe seed host configure -e seed_bootstrap_user=rocky --skip-tags network
- name: Install dependencies
continue-on-error: true
run: |
source venvs/kayobe/bin/activate &&
source src/kayobe-config/kayobe-env --environment ci-builder &&
Expand All @@ -216,7 +207,6 @@ jobs:
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}

- name: Create bifrost_httpboot Docker volume
continue-on-error: true
run: |
source venvs/kayobe/bin/activate &&
source src/kayobe-config/kayobe-env --environment ci-builder &&
Expand Down
72 changes: 42 additions & 30 deletions etc/kayobe/ansible/openstack-host-image-upload.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
# This playbook is desinged to be used by the overcloud-host-image-build.yml
# This playbook is designed to be used by the overcloud-host-image-build.yml
# GitHub workflow to upload newly-built images to a development cloud for
# testing and use in CI.
- name: Upload an OS image to Glance
Expand All @@ -8,35 +8,47 @@
local_image_path: "/opt/kayobe/images/overcloud-{{ os_distribution }}-{{ os_release }}/overcloud-{{ os_distribution }}-{{ os_release }}.qcow2"
image_name: "overcloud-{{ os_distribution }}-{{ os_release }}"
tasks:
- name: Write out clouds.yml
copy:
content: "{{ lookup('ansible.builtin.env', 'CLOUDS_YAML') }}"
dest: clouds.yaml
mode: 0664
- block:
- name: Write out clouds.yaml
copy:
content: "{{ lookup('ansible.builtin.env', 'CLOUDS_YAML') }}"
dest: clouds.yaml
mode: 0600

- name: Write out secure.yml
no_log: true
vars:
- os_secrets:
clouds:
openstack:
auth:
application_credential_id: "{{ lookup('ansible.builtin.env', 'OS_APPLICATION_CREDENTIAL_ID') }}"
application_credential_secret: "{{ lookup('ansible.builtin.env', 'OS_APPLICATION_CREDENTIAL_SECRET') }}"
copy:
content: "{{ os_secrets | to_nice_yaml }}"
dest: secure.yaml
mode: 0664
- name: Write out secure.yaml
no_log: true
vars:
os_secrets:
clouds:
openstack:
auth:
application_credential_id: "{{ lookup('ansible.builtin.env', 'OS_APPLICATION_CREDENTIAL_ID') }}"
application_credential_secret: "{{ lookup('ansible.builtin.env', 'OS_APPLICATION_CREDENTIAL_SECRET') }}"
copy:
content: "{{ os_secrets | to_nice_yaml }}"
dest: secure.yaml
mode: 0600

- name: Ensure dependencies are installed
pip:
name: openstacksdk
- name: Ensure dependencies are installed
pip:
name: openstacksdk

- name: Upload an image to Glance
openstack.cloud.image:
cloud: openstack
name: "{{ image_name }}"
container_format: bare
disk_format: qcow2
state: present
filename: "{{ local_image_path }}"
- name: Upload an image to Glance
openstack.cloud.image:
cloud: openstack
name: "{{ image_name }}"
container_format: bare
disk_format: qcow2
state: present
filename: "{{ local_image_path }}"

always:
- name: Remove clouds.yaml
file:
path: clouds.yaml
state: absent

- name: Remove secure.yaml
file:
path: secure.yaml
state: absent
3 changes: 2 additions & 1 deletion etc/kayobe/environments/ci-builder/inventory/hosts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# A 'seed' host used for building images.
[seed]
localhost ansible_connection=local ansible_python_interpreter=/usr/bin/python3
# localhost ansible_connection=local ansible_python_interpreter=/usr/bin/python3
builder

0 comments on commit 9fb349f

Please sign in to comment.