Skip to content

yoga host image selinux #790

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed

Conversation

markgoddard
Copy link
Contributor

  • RL9: Set SELinux to permissive mode in the standard overcloud host image
  • RL9: Use Pulp repo snapshots when building overcloud host image

From the Zed release, Kayobe changes its default SELinux mode from
disabled to permissive. Changing SELinux from disabled to permissive
mode requires a reboot, so it's best to include the correct mode in the
image.

This change is proposed to the Yoga branch because that is the point of
the RL9 migration, when it is most convenient to make this change.
Doing so requires a backport of the Kayobe patch supporting SELinux
modes, and for Kayobe config to set selinux_mode to permissive (we would
not change the default config in a backport).
@markgoddard markgoddard self-assigned this Nov 15, 2023
Retries have been added to the stackhpc.pulp collection to improve
reliability. Adding the same here.
# DIB_YUM_MINIMAL_BOOTSTRAP_REPOS: /path/to/dir/containing/dib-mirror-*.repo
# On Rocky Linux 9, use the host's repo files.
# These will have been configured to point to Test Pulp repo snapshots during the 'host configure' step.
# FIXME: This assumes we are building on RL9, which may not be the case.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right - we could make it work for CS8 too, but thought I'd focus on the future :)

# On Rocky Linux 9, use the host's repo files.
# These will have been configured to point to Test Pulp repo snapshots during the 'host configure' step.
# FIXME: This assumes we are building on RL9, which may not be the case.
DIB_YUM_MINIMAL_BOOTSTRAP_REPOS: "{% if os_distribution == 'rocky' and os_release == '9' %}/etc/yum.repos.d/{% endif %}"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately this didn't work:

cat /etc/rocky-release
Rocky Linux release 9.3 (Blue Onyx)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because DIB_YUM_MINIMAL_BOOTSTRAP_REPOS works for yum-minimal element, but rocky-container depends on yum element - working on it.

@@ -23,7 +23,7 @@ stackhpc_overcloud_dib_name: "deployment_image"
stackhpc_overcloud_dib_elements:
- "{{ os_distribution }}-{% if os_distribution == 'rocky' %}container-stackhpc{% else %}minimal{% endif %}"
- "cloud-init-datasources"
- "{% if os_distribution in ['centos', 'rocky'] %}disable-selinux{% endif %}"
- "{% if os_distribution == 'rocky' and os_release == '9' %}selinux-permissive{% elif os_distribution in ['centos', 'rocky'] %}disable-selinux{% endif %}"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part did work:

sestatus 
SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   permissive
Mode from config file:          permissive
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Memory protection checking:     actual (secure)
Max kernel policy version:      33

@priteau
Copy link
Member

priteau commented Feb 14, 2024

Should we try to finish merging this?

@markgoddard
Copy link
Contributor Author

Should we try to finish merging this?

It would be a good change to have. Currently we can't use the ARC runner cluster for host image build jobs, so we'd need to either get that working or spin up a separate runner VM.

@markgoddard
Copy link
Contributor Author

Should we try to finish merging this?

It would be a good change to have. Currently we can't use the ARC runner cluster for host image build jobs, so we'd need to either get that working or spin up a separate runner VM.

@Alex-Welsh is going to look at getting image builds working on ARC.

@Alex-Welsh
Copy link
Member

ARC builds are now working! However by "working" i just mean that something builds. There are various issues still present e.g. the Rocky 8 image just builds as Rocky 9 at the moment.

@@ -19,6 +19,9 @@
name: "{{ repository_name }}_{{ promotion_tag }}"
base_path: "{{ base_path }}/{{ promotion_tag }}"
register: distribution_details
until: distribution_details is success
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pulled out this stuff into #1031

@priteau
Copy link
Member

priteau commented Sep 13, 2024

@markgoddard Let's close this one?

@markgoddard markgoddard deleted the yoga-host-image-selinux branch September 13, 2024 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants