diff --git a/ansible/README.md b/ansible/README.md
index 3dfd434219..32675d3169 100644
--- a/ansible/README.md
+++ b/ansible/README.md
@@ -109,7 +109,7 @@ summarized below:
| Type | Families |
| ------------- | -------------- |
| rhel | rhel-7
rhel-8 |
-| rhel-s390x | rhel-8-6-s390x |
+| rhel-s390x | rhel-8-6-s390x
rhel-9-6-s390x
rhel-10-s390x |
| rhel-ppc64le | rhel-8.8-05102023 |
| rhel-sap | rhel-8-4-sap-ha
rhel-8-6-sap-ha |
| cos | cos-stable
cos-beta
cos-dev |
diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml
index 72237f4373..7247d4954c 100644
--- a/ansible/group_vars/all.yml
+++ b/ansible/group_vars/all.yml
@@ -48,6 +48,9 @@ virtual_machines:
ssh_key_file: "~/.ssh/acs-s390x-rsa.prv"
families:
- rhel-8-6-s390x
+ - rhel-9-6-s390x
+ - rhel-10-s390x
+ container_engine: podman
# We have taken families name as "p" since there is a character limit for instance name
# in ibm cloud (56 chars max)
diff --git a/ansible/roles/create-vm/tasks/create-s390x-vm.yml b/ansible/roles/create-vm/tasks/create-s390x-vm.yml
index ea2bd5858b..2e703f2d6e 100644
--- a/ansible/roles/create-vm/tasks/create-s390x-vm.yml
+++ b/ansible/roles/create-vm/tasks/create-s390x-vm.yml
@@ -51,7 +51,7 @@
id: "{{ vsi.resource.id | default(omit) }}"
vpc: "{{ s390x.vpc_id }}"
profile: "{{ s390x.vsi_profile }}"
- image: "{{ s390x.vsi_image_id }}"
+ image: "{{ s390x.image_ids[vm_family] }}"
resource_group: "{{ s390x.vsi_resource_group_id }}"
keys:
- "{{ s390x.ssh_key_id }}"
@@ -99,6 +99,7 @@
- job_id_{{ job_id }}
- platform_{{ test_platform }}
- vm_arch_s390x
+ - container_engine_{{ container_engine }}
ansible_ssh_extra_args: "-o StrictHostKeyChecking=no"
ansible_ssh_private_key_file: "{{ vm_ssh_key_file }}"
vm_config: "{{ vm_config }}"
diff --git a/ansible/roles/destroy-vm/tasks/destroy-s390x-vm.yml b/ansible/roles/destroy-vm/tasks/destroy-s390x-vm.yml
index 1b3795dc1e..579827a8c1 100644
--- a/ansible/roles/destroy-vm/tasks/destroy-s390x-vm.yml
+++ b/ansible/roles/destroy-vm/tasks/destroy-s390x-vm.yml
@@ -19,6 +19,7 @@
zone: "{{ vsi.resource.zone }}"
primary_network_interface:
- subnet: "{{ vsi.resource.primary_network_interface[0].subnet }}"
+ ignore_errors: true
when: vsi.resource.id is defined
- name: Check for existing floating IP
@@ -36,6 +37,7 @@
state: absent
id: "{{ fip.resource.id }}"
zone: "{{ fip.resource.zone }}"
+ ignore_errors: true
when: fip.resource.id is defined
- name: Check for existing Security Group
@@ -51,7 +53,15 @@
delegate_to: localhost
ibm.cloudcollection.ibm_is_security_group:
state: absent
- id: "{{ sg.resource.id }}"
+ name: "{{ inventory_hostname }}-sg"
+ vpc: "{{ s390x.vpc_id }}"
+ register: sg_delete
+ failed_when:
+ - sg_delete.rc | default(0) != 0
+ - '"Target not found" not in (sg_delete.stderr | default(""))'
+ - '"Target not found" not in (sg_delete.msg | default(""))'
+ - '"not_found" not in (sg_delete.stderr | default(""))'
+ - '"not_found" not in (sg_delete.msg | default(""))'
when: sg.resource.id is defined
- name: Remove IBM inventory file (delete file)
diff --git a/ansible/roles/provision-vm/tasks/redhat.yml b/ansible/roles/provision-vm/tasks/redhat.yml
index affde2c929..2978b49964 100644
--- a/ansible/roles/provision-vm/tasks/redhat.yml
+++ b/ansible/roles/provision-vm/tasks/redhat.yml
@@ -64,3 +64,13 @@
update_cache: true
when: runtime_command == 'podman'
+# Collector binds host ports 8080 (HTTP API) and 9090 (Prometheus metrics) when
+# running integration tests. RHEL Web Console (cockpit) also defaults to 9090
+# and is installed on many RHEL images (including RHEL 10 on s390x).
+- name: Disable cockpit socket (conflicts with collector Prometheus port 9090)
+ ansible.builtin.systemd:
+ name: cockpit.socket
+ state: stopped
+ enabled: false
+ failed_when: false
+
diff --git a/ansible/roles/run-test-target/tasks/pull-images.yml b/ansible/roles/run-test-target/tasks/pull-images.yml
index fe0b744eda..71a59d2136 100644
--- a/ansible/roles/run-test-target/tasks/pull-images.yml
+++ b/ansible/roles/run-test-target/tasks/pull-images.yml
@@ -12,7 +12,8 @@
delegate_to: localhost
- name: Pull QA images
- command: "{{ 'sudo' if runtime_as_root else '' }} {{ runtime_command }} pull {{ item.value }}-{{ qa_tag }}"
+ become: "{{ runtime_as_root }}"
+ command: "{{ runtime_command }} pull {{ item.value }}-{{ qa_tag }}"
loop: "{{ images.qa | dict2items }}"
# parallel for speeeeed
async: 300
@@ -21,7 +22,8 @@
ignore_errors: true
- name: Pull non-QA images
- command: "{{ 'sudo' if runtime_as_root else '' }} {{ runtime_command }} pull {{ item.value }}"
+ become: "{{ runtime_as_root }}"
+ command: "{{ runtime_command }} pull {{ item.value }}"
loop: "{{ images.non_qa | dict2items }}"
# parallel for speeeeed
async: 300
diff --git a/ansible/roles/run-test-target/tasks/test-docker.yml b/ansible/roles/run-test-target/tasks/test-docker.yml
index 7b6d7a9c85..0037974a9c 100644
--- a/ansible/roles/run-test-target/tasks/test-docker.yml
+++ b/ansible/roles/run-test-target/tasks/test-docker.yml
@@ -54,10 +54,16 @@
become: "{{ runtime_as_root }}"
shell:
cmd: |
- if [[ -f "/run/containers/0/auth.json" ]]; then
mkdir -p ~/.docker/
- cp "/run/containers/0/auth.json" ~/.docker/config.json
- fi
+ if [[ -f "${XDG_RUNTIME_DIR:-}/containers/auth.json" ]]; then
+ AUTH_FILE="${XDG_RUNTIME_DIR:-}/containers/auth.json"
+ elif [[ -f "/run/containers/0/auth.json" ]]; then
+ AUTH_FILE="/run/containers/0/auth.json"
+ else
+ echo >&2 "No valid auth.json file found"
+ exit 1
+ fi
+ cp "${AUTH_FILE}" ~/.docker/config.json
creates: ~/.docker/config.json
when: runtime_command == "podman"
diff --git a/ansible/vars/s390x.yml b/ansible/vars/s390x.yml
index 47e3759dbb..c6b6405a93 100644
--- a/ansible/vars/s390x.yml
+++ b/ansible/vars/s390x.yml
@@ -2,8 +2,10 @@
s390x:
- #rhel-8-6-s390x
- vsi_image_id: r014-bd269dc6-aa79-4998-b2bc-1eccbda68ed2
+ image_ids:
+ rhel-8-6-s390x: r014-bd269dc6-aa79-4998-b2bc-1eccbda68ed2
+ rhel-9-6-s390x: r014-a8eb2566-9128-40ab-a91f-a6e0e18c8426
+ rhel-10-s390x: r014-18b71370-7941-4ee5-8f07-93d8fb3803ce
vsi_profile: bz2-2x8
# IBM Cloud setup