forked from openstack-k8s-operators/data-plane-adoption
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* New test make target `test-with-ironic`, runs playbook tests_with_ironic.yaml. * The `ironic_adoption` role contains the steps to adopt ironic and ironic-inspector services. * Minor changes to roles keystone_adoption and ovn_adoption to facilitate the ironic adoption. * Split up tasks in nova_adoption role to `nova_libvirt.yaml` and `nova_ironic.yaml`. Use condition on `ironic_adoption` var to include the appropriate tasks file.
- Loading branch information
Showing
18 changed files
with
639 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
- name: Prelude | ||
hosts: local | ||
gather_facts: false | ||
module_defaults: | ||
ansible.builtin.shell: | ||
executable: /bin/bash | ||
roles: | ||
- prelude_local | ||
|
||
- name: Cleanup | ||
hosts: local | ||
gather_facts: false | ||
module_defaults: | ||
ansible.builtin.shell: | ||
executable: /bin/bash | ||
roles: | ||
- pcp_cleanup | ||
|
||
- name: Adoption | ||
hosts: local | ||
gather_facts: false | ||
force_handlers: true | ||
module_defaults: | ||
ansible.builtin.shell: | ||
executable: /bin/bash | ||
vars: | ||
ironic_adoption: true | ||
roles: | ||
- role: development_environment | ||
- role: backend_services | ||
- role: pull_openstack_configuration | ||
- role: stop_openstack_services | ||
- role: mariadb_copy | ||
- role: ovn_adoption | ||
- role: keystone_adoption | ||
- role: neutron_adoption | ||
- role: swift_adoption | ||
- role: glance_adoption | ||
- role: ironic_adoption | ||
- role: placement_adoption | ||
- role: nova_adoption | ||
- role: stop_remaining_services |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,40 @@ | ||
set -e | ||
|
||
function wait_node_state() { | ||
local node_state=$1 | ||
local retries=50 | ||
local counter=0 | ||
set +e | ||
until ! ${BASH_ALIASES[openstack]} baremetal node list -f value -c "Provisioning\ State" | grep -P "^(?!${node_state}).*$"; do | ||
if [[ "$counter" -eq "$retries" ]]; then | ||
echo "ERROR: Timeout. Nodes did not reach provisioning state: ${node_state}" | ||
exit 1 | ||
fi | ||
echo "Waiting for nodes to reach provisioning state: ${node_state}" | ||
sleep 10 | ||
((counter++)) | ||
done | ||
set -e | ||
} | ||
|
||
function wait_image_active() { | ||
local image_name=$1 | ||
local retries=100 | ||
local counter=0 | ||
set +e | ||
until ! ${BASH_ALIASES[openstack]} image show Fedora-Cloud-Base-38 -f value -c status | grep -P "^(?!active).*$"; do | ||
if [[ "$counter" -eq "$retries" ]]; then | ||
echo "ERROR: Timeout. Image: ${image_name} did not reach state: active" | ||
exit 1 | ||
fi | ||
echo "Waiting for image \"${image_name}\" to reach state \"active\"" | ||
sleep 10 | ||
((counter++)) | ||
done | ||
set -e | ||
} | ||
|
||
|
||
# If the snapshot was reverted, and time is way off we get SSL issues in agent<->ironic connection | ||
# Workaround by restarting chronyd.service | ||
ssh -i $EDPM_PRIVATEKEY_PATH [email protected] systemctl restart chronyd.service | ||
|
@@ -37,22 +72,29 @@ URL=https://download.fedoraproject.org/pub/fedora/linux/releases/38/Cloud/x86_64 | |
curl --silent --show-error -o /tmp/${IMG} -L $URL | ||
DISK_FORMAT=$(qemu-img info /tmp/${IMG} | grep "file format:" | awk '{print $NF}') | ||
${BASH_ALIASES[openstack]} image create --container-format bare --disk-format ${DISK_FORMAT} Fedora-Cloud-Base-38 < /tmp/${IMG} | ||
wait_image_active Fedora-Cloud-Base-38 | ||
|
||
|
||
export BAREMETAL_NODES=$(${BASH_ALIASES[openstack]} baremetal node list -c UUID -f value) | ||
# Manage nodes | ||
for node in $BAREMETAL_NODES; do | ||
${BASH_ALIASES[openstack]} baremetal node manage $node --wait 120 | ||
${BASH_ALIASES[openstack]} baremetal node manage $node | ||
done | ||
wait_node_state "manageable" | ||
|
||
# Inspect baremetal nodes | ||
for node in $BAREMETAL_NODES; do | ||
${BASH_ALIASES[openstack]} baremetal node inspect $node --wait 300 | ||
${BASH_ALIASES[openstack]} baremetal node inspect $node | ||
sleep 10 | ||
done | ||
wait_node_state "manageable" | ||
|
||
# Provide nodes | ||
for node in $BAREMETAL_NODES; do | ||
${BASH_ALIASES[openstack]} baremetal node provide $node --wait 300 | ||
${BASH_ALIASES[openstack]} baremetal node provide $node | ||
sleep 10 | ||
done | ||
wait_node_state "available" | ||
|
||
# Wait for nova to be aware of the node | ||
sleep 60 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
dependencies: | ||
- role: common_defaults |
Oops, something went wrong.