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

[master] Distribute saltexts in salt-ssh thin package #66522

Merged
merged 5 commits into from
May 22, 2024

Conversation

lkubb
Copy link
Contributor

@lkubb lkubb commented May 15, 2024

What does this PR do?

Adds packages that provide a salt.loader entrypoint to the Salt-SSH thin archive.

What issues does this PR fix or reference?

Fixes: #66559

(marginally related: saltstack/salt-bootstrap#1975 https://gitlab.com/saltstack/pop/heist-salt/-/issues/9 https://gitlab.com/saltstack/pop/heist-salt/-/issues/73)

Previous Behavior

No way of using Salt extensions via Salt-SSH

New Behavior

Salt extensions can work via Salt-SSH

Merge requirements satisfied?

Commits signed with GPG?

Yes

Additional context

Definite issues:

  • Extension requirements are not included (same as for custom extmods - but in many cases they could be, I suspect, at least explicitly - defined by the extension.)

Possible issues:

  • Not sure if I'm missing something obvious, this is very far out of my comfort zone
  • The entry_points.txt file stats are not set at all (we could just include the file itself if the filtering is unnecessary, but I'm not exactly sure how to get the absolute path to it without accessing an internal attribute)
  • No support for the alternatives system in the current form

I don't think this has any security implications since the modules are loaded on the master anyways.

This is an unpolished proof of concept of how to distribute Salt
extensions together with the thin package.
@lkubb
Copy link
Contributor Author

lkubb commented May 15, 2024

@max-arnold You might be interested in this.

It would be awesome if @s0undt3ch could leave a comment [since you're probably the most knowledgeable in this domain :)].

@max-arnold
Copy link
Contributor

max-arnold commented May 15, 2024

Cool, thanks for tagging me!

Didn't test your changes yet (will have some time next week), but there are two features this might potentially interfere with (i.e. worth checking):

  1. Does it work with enable_ssh_minions master mode?
  2. Are there potential implications/duplication related to --min-extra-modules and --thin-extra-modules options for salt-ssh CLI?

Also, are there any downsides of enabling this flag by default? I guess this can be done via Saltfile if someone doesn't want to always specify the CLI flag, but maybe this option being True by default will result in a better experience out of the box?

@lkubb
Copy link
Contributor Author

lkubb commented May 15, 2024

Cool, thanks for tagging me!

Thanks for answering :)

Also, are there any downsides of enabling this flag by default? I guess this can be done via Saltfile if someone doesn't want to always specify the CLI flag, but maybe this option being True by default will result in a better experience out of the box?

Two (likely minor) issues that come to mind are a) a minor processing overhead b) possibly some issues where new libs are introduced into an environment that weren't there before.
I agree we should consider making this the default behavior if it seems stable though.

Note: Since thin_include_saltexts is read from opts, it should be possible to just enable it in the master opts. I didn't do it like that in the test since it was more straight-forward with the flag, but will test manually if it works as intended.

1. Does it work with `enable_ssh_minions` master mode?

If enabled in the master opts, it should work.

2. Are there potential implications related to `--min-extra-modules` and `--thin-extra-modules` options for `salt-ssh` CLI?

min) This does not touch gen_min at all - Should it? I'm not familiar with it tbh.
thin) Something that comes to mind is that if a saltext or one of its submodules is specified in there, it might be included twice. Not sure if that causes issues, but it might be a good precaution to at least deduplicate the autodiscovered mods from the existing ones.

@max-arnold
Copy link
Contributor

I too have no idea what --min-extra-modules does (and what "Minimal Salt" is used for), mentioned it just in case

@lkubb lkubb marked this pull request as ready for review May 19, 2024 10:09
@lkubb lkubb requested a review from a team as a code owner May 19, 2024 10:09
@lkubb lkubb requested review from dwoz and removed request for a team May 19, 2024 10:09
@lkubb lkubb changed the title [master] Distribute saltexts in salt-ssh thin package [PoC] [master] Distribute saltexts in salt-ssh thin package May 19, 2024
@dwoz dwoz merged commit 06e325f into saltstack:master May 22, 2024
182 checks passed
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.

[FEATURE REQUEST] Include saltexts in Salt-SSH thin archive
3 participants