rhel9: fix conditionals for sysroot.readonly enablement

Signed-off-by: Antonio Murdaca <antoniomurdaca@gmail.com>
This commit is contained in:
Antonio Murdaca 2023-02-08 18:29:07 +01:00 committed by Achilleas Koutsou
parent 1b9e008c29
commit 6afab3dff2
2 changed files with 31 additions and 8 deletions

View file

@ -259,7 +259,7 @@
# There are three checks here for /sysroot permission based on pr https://github.com/osbuild/osbuild-composer/pull/3053
# 1. for edge-commit and edge-installer, check ro when fedora >= 37
# 2. for edge-commit and edge-installer, check rw for other os.
# 3. for edge-simplified-installer and edge-raw-image, check ro for all os.
# 3. for edge-simplified-installer and edge-raw-image, check ro for 9.2+ and F37+.
- name: /sysroot should be mount with ro permission for edge-commit and edge-installer on Fedora >= 37
block:
- assert:
@ -307,7 +307,26 @@
- name: failed count + 1
set_fact:
failed_counter: "{{ failed_counter | int + 1 }}"
when: edge_type == "edge-simplified-installer" or edge_type == "edge-raw-image"
when: (edge_type == "edge-simplified-installer" or edge_type == "edge-raw-image") and ((ansible_facts['distribution'] == 'Fedora' and ansible_facts['distribution_version'] is version('37', '>=')) or
(ansible_facts['distribution'] == 'CentOS' and ansible_facts['distribution_version'] is version('9', '>=')) or (ansible_facts['distribution'] == 'RedHat' and ansible_facts['distribution_version'] is version('9.2', '>=')))
- name: /sysroot should be mount with rw permission for edge-simplified-installer and edge-raw-image for <9.2 and <F37
block:
- assert:
that:
- result_sysroot_mount_status.stdout == "rw"
fail_msg: "/sysroot is not mounted with rw permission"
success_msg: "/sysroot is mounted with rw permission"
always:
- set_fact:
total_counter: "{{ total_counter | int + 1 }}"
rescue:
- name: failed count + 1
set_fact:
failed_counter: "{{ failed_counter | int + 1 }}"
when: (edge_type == "edge-simplified-installer" or edge_type == "edge-raw-image") and ((ansible_facts['distribution'] == 'Fedora' and ansible_facts['distribution_version'] is version('37', '<')) or
(ansible_facts['distribution'] == 'CentOS' and ansible_facts['distribution_version'] is version('9', '<')) or (ansible_facts['distribution'] == 'RedHat' and ansible_facts['distribution_version'] is version('9.2', '<')))
# case: check /var mount point
- name: check /var mount point