ci: fix various issues preventing complete runs

When creating a coe cluster, a flavor lookup occurs which
fails as nothing is specified. This adds a default flavor
which can be used to test cluster provisioning.

Various checks used a deprecated truthy check which no
longer works with Ansible 2.19

Inventory cache format change in Ansible 2.19

galaxy.yml required in tmp testing directory or version
checks fail for linters with Ansible 2.19

Change-Id: Iaf3f05d0841a541e4318821fe44ddd59f236b640
This commit is contained in:
Andrew Bonney
2025-07-24 09:18:04 +01:00
parent f584c54dfd
commit e84ebb0773
6 changed files with 13 additions and 6 deletions

View File

@@ -72,6 +72,8 @@
image_id: '{{ image_id }}' image_id: '{{ image_id }}'
is_floating_ip_enabled: true is_floating_ip_enabled: true
keypair_id: '{{ keypair.keypair.id }}' keypair_id: '{{ keypair.keypair.id }}'
flavor_id: 'm1.small'
master_flavor_id: 'm1.small'
name: k8s name: k8s
state: present state: present
register: coe_cluster_template register: coe_cluster_template

View File

@@ -241,7 +241,7 @@
that: that:
- server1_fips is success - server1_fips is success
- server1_fips is not changed - server1_fips is not changed
- server1_fips.floating_ips - server1_fips.floating_ips|length > 0
# allow new fields to be introduced but prevent fields from being removed # allow new fields to be introduced but prevent fields from being removed
- expected_fields|difference(server1_fips.floating_ips[0].keys())|length == 0 - expected_fields|difference(server1_fips.floating_ips[0].keys())|length == 0
@@ -260,7 +260,7 @@
- name: Assert return values of floating_ip module - name: Assert return values of floating_ip module
assert: assert:
that: that:
- floating_ip.floating_ip - floating_ip.floating_ip|length > 0
# allow new fields to be introduced but prevent fields from being removed # allow new fields to be introduced but prevent fields from being removed
- expected_fields|difference(floating_ip.floating_ip.keys())|length == 0 - expected_fields|difference(floating_ip.floating_ip.keys())|length == 0
@@ -312,7 +312,7 @@
- name: Assert floating ip attached to server 2 - name: Assert floating ip attached to server 2
assert: assert:
that: that:
- server2_fip.floating_ip - server2_fip.floating_ip|length > 0
- name: Find all floating ips for debugging - name: Find all floating ips for debugging
openstack.cloud.floating_ip_info: openstack.cloud.floating_ip_info:

View File

@@ -279,6 +279,11 @@
ansible.builtin.set_fact: ansible.builtin.set_fact:
cache: "{{ cache.content | b64decode | from_yaml }}" cache: "{{ cache.content | b64decode | from_yaml }}"
- name: Further process Ansible 2.19+ cache
ansible.builtin.set_fact:
cache: "{{ cache.__payload__ | from_yaml }}"
when: cache.__payload__ is defined
- name: Check Ansible's cache - name: Check Ansible's cache
assert: assert:
that: that:

View File

@@ -38,7 +38,7 @@
- name: Ensure public key is returned - name: Ensure public key is returned
assert: assert:
that: that:
- keypair.keypair.public_key is defined and keypair.keypair.public_key - keypair.keypair.public_key is defined and keypair.keypair.public_key|length > 0
- name: Create another keypair - name: Create another keypair
openstack.cloud.keypair: openstack.cloud.keypair:

View File

@@ -11,7 +11,7 @@
- name: Check output of creating network - name: Check output of creating network
assert: assert:
that: that:
- infonet.network - infonet.network is defined
- item in infonet.network - item in infonet.network
loop: "{{ expected_fields }}" loop: "{{ expected_fields }}"

View File

@@ -24,7 +24,7 @@ echo "Running test with Python version ${PY_VER}"
rm -rf "${ANSIBLE_COLLECTIONS_PATH}" rm -rf "${ANSIBLE_COLLECTIONS_PATH}"
mkdir -p ${ANSIBLE_COLLECTIONS_PATH}/ansible_collections/openstack/cloud mkdir -p ${ANSIBLE_COLLECTIONS_PATH}/ansible_collections/openstack/cloud
cp -a ${TOXDIR}/{plugins,meta,tests,docs} ${ANSIBLE_COLLECTIONS_PATH}/ansible_collections/openstack/cloud cp -a ${TOXDIR}/{plugins,meta,tests,docs,galaxy.yml} ${ANSIBLE_COLLECTIONS_PATH}/ansible_collections/openstack/cloud
cd ${ANSIBLE_COLLECTIONS_PATH}/ansible_collections/openstack/cloud/ cd ${ANSIBLE_COLLECTIONS_PATH}/ansible_collections/openstack/cloud/
echo "Running ansible-test with version:" echo "Running ansible-test with version:"
ansible --version ansible --version