Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
17 changes: 16 additions & 1 deletion molecule/build_image_aarch64/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,21 @@
ansible.builtin.debug:
msg: "✔ All S3 containers are running: {{ s3_containers | join(', ') }}"

# =========================================================================
# INSTALL SQUASHFS-TOOLS (REQUIRED FOR MOUNTING S3 IMAGES)
# =========================================================================

- name: Install squashfs-tools package in omnia_core container
ansible.builtin.command:
cmd: podman exec {{ container_name }} dnf install -y squashfs-tools
register: squashfs_install
changed_when: squashfs_install.rc == 0
failed_when: false

- name: Display squashfs-tools installation result
ansible.builtin.debug:
msg: "squashfs-tools installation: {{ 'SUCCESS' if squashfs_install.rc == 0 else 'FAILED (may already be installed)' }}"

# =========================================================================
# SYNC PROJECT_DEFAULT INTO CONTAINER
# =========================================================================
Expand Down Expand Up @@ -132,7 +147,7 @@
- name: Execute build_image_aarch64 playbook in omnia_core container
ansible.builtin.shell:
cmd: |
podman exec -it -w /omnia/build_image_aarch64 {{ container_name }} \
podman exec -w /omnia/build_image_aarch64 {{ container_name }} \
ansible-playbook build_image_aarch64.yml -v
register: playbook_result
when: "'EXISTS' in playbook_check.stdout"
Expand Down
17 changes: 16 additions & 1 deletion molecule/build_image_x86_64/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,21 @@
ansible.builtin.debug:
msg: "✔ All S3 containers are running: {{ s3_containers | join(', ') }}"

# =========================================================================
# INSTALL SQUASHFS-TOOLS (REQUIRED FOR MOUNTING S3 IMAGES)
# =========================================================================

- name: Install squashfs-tools package in omnia_core container
ansible.builtin.command:
cmd: podman exec {{ container_name }} dnf install -y squashfs-tools
register: squashfs_install
changed_when: squashfs_install.rc == 0
failed_when: false

- name: Display squashfs-tools installation result
ansible.builtin.debug:
msg: "squashfs-tools installation: {{ 'SUCCESS' if squashfs_install.rc == 0 else 'FAILED (may already be installed)' }}"

# =========================================================================
# SYNC PROJECT_DEFAULT INTO CONTAINER
# =========================================================================
Expand Down Expand Up @@ -132,7 +147,7 @@
- name: Execute build_image_x86_64 playbook in omnia_core container
ansible.builtin.shell:
cmd: |
podman exec -it -w /omnia/build_image_x86_64 {{ container_name }} \
podman exec -w /omnia/build_image_x86_64 {{ container_name }} \
ansible-playbook build_image_x86_64.yml -v
register: playbook_result
when: "'EXISTS' in playbook_check.stdout"
Expand Down
3 changes: 2 additions & 1 deletion molecule/discovery/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,11 @@
ansible.builtin.shell: # noqa: risky-shell-pipe
cmd: >
podman exec {{ container_name }}
bash -o pipefail -c
bash -c
'ls /omnia/utils/set_pxe_boot.yml /omnia/discovery/set_pxe_boot.yml 2>/dev/null | head -1'
register: pxe_boot_playbook_check
changed_when: false
failed_when: false

- name: Set PXE boot playbook path
ansible.builtin.set_fact:
Expand Down
59 changes: 56 additions & 3 deletions molecule/omnia_sh_uninstall/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
omnia_clone_path: "{{ omnia_test_config.omnia_clone_path | default('/opt/omnia-artifactory') }}"
omnia_sh_path: "{{ omnia_clone_path }}/omnia.sh"
omnia_shared_path: "{{ omnia_test_config.omnia_shared_path | default('/opt/omnia') }}"
omnia_branch: "{{ omnia_test_config.get('omnia_branch', '') }}"
container_name: "omnia_core"

tasks:
Expand All @@ -61,19 +62,71 @@
msg: "Container {{ container_name }} not found on {{ ansible_host }}, skipping uninstall"
when: container_exists.rc != 0

- name: Check if omnia.sh exists
ansible.builtin.stat:
path: "{{ omnia_sh_path }}"
register: omnia_sh_stat
when: container_exists.rc == 0

- name: Check if omnia_branch is defined
ansible.builtin.debug:
msg: "omnia_branch: {{ omnia_branch }}"
when: container_exists.rc == 0 and not omnia_sh_stat.stat.exists

- name: Skip download if omnia_branch not defined
ansible.builtin.debug:
msg: "omnia_branch not defined in omnia_test_config.yml, skipping download"
when: container_exists.rc == 0 and not omnia_sh_stat.stat.exists and omnia_branch == ''

- name: Create omnia_clone_path directory
ansible.builtin.file:
path: "{{ omnia_clone_path }}"
state: directory
mode: '0755'
when: container_exists.rc == 0 and not omnia_sh_stat.stat.exists and omnia_branch != ''

- name: Download omnia.sh from GitHub (tags)
ansible.builtin.get_url:
url: "https://raw.githubusercontent.com/dell/omnia/refs/tags/{{ omnia_branch }}/omnia.sh"
dest: "{{ omnia_sh_path }}"
mode: '0755'
register: download_tags
when: container_exists.rc == 0 and not omnia_sh_stat.stat.exists and omnia_branch != ''
failed_when: false

- name: Download omnia.sh from GitHub (heads) if tags failed
ansible.builtin.get_url:
url: "https://raw.githubusercontent.com/dell/omnia/refs/heads/{{ omnia_branch }}/omnia.sh"
dest: "{{ omnia_sh_path }}"
mode: '0755'
register: download_heads
when: container_exists.rc == 0 and not omnia_sh_stat.stat.exists and omnia_branch != '' and download_tags is failed
failed_when: false

- name: Skip uninstall if omnia.sh download failed
ansible.builtin.debug:
msg: "Failed to download omnia.sh from both tags and heads, skipping uninstall"
when: container_exists.rc == 0 and not omnia_sh_stat.stat.exists and omnia_branch != '' and download_tags is failed and download_heads is failed

- name: Make omnia.sh executable
ansible.builtin.file:
path: "{{ omnia_sh_path }}"
mode: '0755'
when: container_exists.rc == 0 and (omnia_sh_stat.stat.exists or download_tags is succeeded or download_heads is succeeded)

- name: Run omnia.sh --uninstall with auto-confirm
ansible.builtin.shell:
cmd: set -o pipefail && echo "y" | {{ omnia_sh_path }} --uninstall
register: uninstall_result
when: container_exists.rc == 0
when: container_exists.rc == 0 and (omnia_sh_stat.stat.exists or download_tags is succeeded or download_heads is succeeded)
changed_when: uninstall_result.rc == 0

- name: Fail if uninstall failed
ansible.builtin.fail:
msg: "omnia.sh --uninstall failed: {{ uninstall_result.stderr | default('Unknown error') }}"
when: container_exists.rc == 0 and uninstall_result.rc != 0
when: container_exists.rc == 0 and (omnia_sh_stat.stat.exists or download_tags is succeeded or download_heads is succeeded) and uninstall_result.rc != 0

- name: Cleanup completed
ansible.builtin.debug:
msg: "omnia.sh --uninstall completed on {{ ansible_host }}"
when: container_exists.rc == 0
when: container_exists.rc == 0 and (omnia_sh_stat.stat.exists or download_tags is succeeded or download_heads is succeeded)
1 change: 0 additions & 1 deletion molecule/slurm/tests/sanity/test_slurm.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@
# TC1: All nodes from PXE mapping are joined to Slurm cluster
# =============================================================================

@pytest.mark.sanity
@pytest.mark.order(1)
def test_all_pxe_nodes_in_slurm_cluster(host):
"""Test that all nodes in PXE mapping are joined to the Slurm cluster."""
Expand Down
Loading