Skip to content
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

Post deployments for content hosts, starting with FIPS #16903

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jyejare
Copy link
Member

@jyejare jyejare commented Nov 13, 2024

Problem Statement

  • The existing FIPS WF is going to be deleted as RHEL10 demands the enablement of FIPS as a separate task
  • Resulting the WF to be deleted from Lab and introduce new enable-fips WF for any RHEL
  • Currently, robottelo does not support 2 steps installation of FIPS and hence that needs to handle in robottelo

Solution

  • Introducing the post deployments for content hosts which should run procedures on content host based on conditions
  • Starting with FIPS, when the content host is entitled for FIPS the enable_fips WF should run on the given host hence supporting 2 steps FIPS Content host
  • Also, the existing content host template is updated for FIPS to deploy_rhel instead of the previous (To be Removed) WF.

Related Issues

@jyejare jyejare requested a review from a team as a code owner November 13, 2024 10:19
@jyejare jyejare added CherryPick PR needs CherryPick to previous branches 6.13.z Introduced in or relating directly to Satellite 6.13 6.14.z Introduced in or relating directly to Satellite 6.14 6.15.z Introduced in or relating directly to Satellite 6.15 6.16.z Introduced in or relating directly to Satellite 6.16 labels Nov 13, 2024
@jyejare jyejare marked this pull request as draft November 13, 2024 10:20
Comment on lines 44 to 50
def run_post_deployments(request, host):
"""Execute post deploy"""
params = {}
if hasattr(request, 'param'):
params = request.param
if 'fips' in params.get('rhel_version'):
Broker().execute(workflow='enable-fips', target_host=host.name)
Copy link
Member

Choose a reason for hiding this comment

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

Did you consider putting this logic into ContentHost.setup method? If we would go that route, we would need to pass params['rhel_version'] (as a metadata) to broker through the host_conf method, so we can read it later on in the setup method. This is something we already do with blank=True.

https://github.com/ogajduse/robottelo/blob/8fff2ede1a86937f0dd6f4275b3b603de39c8c3b/pytest_fixtures/component/provision_pxe.py#L231

Copy link
Member Author

Choose a reason for hiding this comment

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

Did not consider that for sure, but It was a perfect suggestion.

I choose this route to keep the content host procedures native to content host fixtures in this module for easy understanding and debug.

But anyways now we had to close the PR :(

Copy link
Member Author

@jyejare jyejare Nov 19, 2024

Choose a reason for hiding this comment

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

@ogajduse We are again allowed to go this path after some brainstorming in the Lab team. I have addressed your comment and its subject to verification by running PRT post enable-fips WF merged in Tower.

@jyejare jyejare force-pushed the post_deployments_fips branch 2 times, most recently from c895af9 to aa21a03 Compare November 19, 2024 09:54
deploy_rhel_version: '9'
target_memory: 1536 MiB
target_cores: 1
rhel10_fips:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
rhel10_fips:
rhel10:

deploy_rhel_version: '9'
target_memory: 1536 MiB
target_cores: 1
container:
container_host: ubi9:latest
rhel9_fips:
vm:
workflow: deploy-base-rhel-fips
workflow: deploy-rhel
deploy_rhel_version: '9'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
deploy_rhel_version: '9'
deploy_rhel_version: '9'
deploy_fips_enable: true

Comment on lines 29 to 30
target_memory: 1536 MiB
target_cores: 1
Copy link
Collaborator

Choose a reason for hiding this comment

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

target_cores and target_memory options can be removed since it won't do anything for VM deployed in RHOS

@@ -37,6 +37,9 @@ def host_conf(request):
deploy_kwargs = settings.content_host.get(_rhelver).to_dict().get('vm', {})
if network := params.get('network'):
deploy_kwargs.update({'deploy_network_type': network})
# Post_deploy_workflow_runs to be run in ContentHost.setup method
if 'fips' in params.get('rhel_version'):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
if 'fips' in params.get('rhel_version'):
if 'rhel10_fips' in params.get('rhel_version'):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.13.z Introduced in or relating directly to Satellite 6.13 6.14.z Introduced in or relating directly to Satellite 6.14 6.15.z Introduced in or relating directly to Satellite 6.15 6.16.z Introduced in or relating directly to Satellite 6.16 CherryPick PR needs CherryPick to previous branches
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants