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

Fixes #38109 - As a user, I want to install flatpaks on remote hosts via REX #11264

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sjha4
Copy link
Member

@sjha4 sjha4 commented Dec 17, 2024

What are the changes introduced in this pull request?

Adds a new job template to setup flatpak remote, authentication and possibly install a flatpak repo on a host

Considerations taken when implementing this change?

We are not installing flatpak/podman. Admin/Client will need to do that on their own.
This will need to be run with sudo or as root on the host

What are the testing steps for this pull request?

  1. Run the job template on a host.
  2. Monitor the execution output and make sure you are able to see the flatpak installation on the host.

@sjha4 sjha4 changed the title Fixes #38109 - As a user, I want to install flatpaks on remote hosts Fixes #38109 - As a user, I want to install flatpaks on remote hosts via REX Dec 17, 2024
Copy link
Member

@jeremylenz jeremylenz left a comment

Choose a reason for hiding this comment

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

Thanks @sjha4

I did not test this yet, but left some annoying nitpicks etc. below. Sorry!

@@ -0,0 +1,37 @@
<%#
kind: job_template
name: Install Flatpak and Firefox
Copy link
Member

Choose a reason for hiding this comment

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

I'm assuming you're changing this so it's an input and not hard-coded to Firefox, right? Why have a template specifically for Firefox?

Copy link
Member Author

Choose a reason for hiding this comment

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

No..This was bait for you to take a look and drive the PR from here on.. <3

Copy link
Member

Choose a reason for hiding this comment

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

You know how to trick me!

kind: job_template
name: Install Flatpak and Firefox
job_category: Katello
description_format: 'Install Flatpak and Firefox'
Copy link
Member

Choose a reason for hiding this comment

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

description_format can use wildcards and incorporate the input.

Comment on lines 17 to 18
- name: Password
description: Password for container registry login
Copy link
Member

Choose a reason for hiding this comment

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

This is where we're meant to use the personal auth token, right? Maybe the input or description should call that out.

flatpak remote-add --authenticator-name=org.flatpak.Authenticator.Oci <%= remote_name %> oci+<%= server_url %>/
podman login <%= server_url %> --username <%= username %> --password <%= password %>
cp /run/containers/0/auth.json /etc/flatpak/oci-auth.json
flatpak install firefox --assumeyes
Copy link
Member

Choose a reason for hiding this comment

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

The actual install could probably be split into a second template, and then called here with render_template. Then you could do flatpak installs separately assuming your installations and logins are already in place.

name: Install Flatpak and Firefox
job_category: Katello
description_format: 'Install Flatpak and Firefox'
feature: katello_host_flatpak_install
Copy link
Member

Choose a reason for hiding this comment

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

If you're introducing a new REX feature, you'll have to register the feature (in plugin.rb I think?)

You don't have to use a feature, if you don't need easy access from Hammer or web UI..

@sjha4
Copy link
Member Author

sjha4 commented Dec 20, 2024

@jeremylenz Thanks for the reviews..Working on them. This is kind of an early draft to make sure the flow makes sense..I'll split this into 2 templates : 1 for remote-add/authentication and another for the flatpak install.

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.

2 participants