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

WIP: Hackweek - Configure proxy formula #178

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mbussolotto
Copy link
Member

@mbussolotto mbussolotto commented Jun 28, 2022

This formula provides a new procedure for setting a uyuni proxy. With this new formula, the steps would be:

  • generate ca certificate, server certificate and server.key on Uyuni using Systems -> Proxy Configuration
  • run configure-proxy formula

ca certificate, server certificate and server.key can be saved on the local uyuni proxy or they can be remote

Test can be found here: https://build.opensuse.org/package/show/home:mbussolotto/configure-proxy-formula

@mbussolotto mbussolotto changed the title Configure proxy formula Hackweek - Configure proxy formula Jun 30, 2022
@mbussolotto mbussolotto marked this pull request as ready for review June 30, 2022 11:25
@mbussolotto
Copy link
Member Author

In my really simple scenario is working fine, but I don't know if it can be fine in more complicated environment. Any opinions is welcome

Copy link
Member

@aaannz aaannz left a comment

Choose a reason for hiding this comment

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

Aren't you missing file or state generating config-answers.txt?

configure-proxy-formula/configure-proxy-formula.spec Outdated Show resolved Hide resolved
configure-proxy-formula/configure-proxy-formula.spec Outdated Show resolved Hide resolved
@mbussolotto mbussolotto marked this pull request as draft June 30, 2022 13:31
@mbussolotto mbussolotto force-pushed the configure-proxy-formula branch from df78905 to e555396 Compare July 1, 2022 11:28
@mbussolotto mbussolotto marked this pull request as ready for review July 1, 2022 11:29
pkg.installed

{%- if salt['pillar.get']('configure-proxy:ssl:key_group') %}
/root/ssl-build/server.key:
Copy link
Member

Choose a reason for hiding this comment

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

I know that this is path we have always used, but that was because of user interaction. With salt states we can actually use something more in-line with FHS (even though FHS is these days not relevant).

How about storing it in /run? Once we call configure-proxy, it calls mgr-ssl-cert-setup which will store certificates to the proper places and these downloaded files are no longer needed. So they can be removed later. /run is tmpfs these days.

configure-proxy-formula/configure-proxy/init.sls Outdated Show resolved Hide resolved
configure-proxy-formula/configure-proxy/init.sls Outdated Show resolved Hide resolved
configure-proxy-formula/metadata/form.yml Show resolved Hide resolved
@mbussolotto mbussolotto requested a review from aaannz July 4, 2022 07:12
Copy link
Member

@aaannz aaannz left a comment

Choose a reason for hiding this comment

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

If this is just for us, then LGTM.

If we want to create package and ship it, then we need form for server username and password. Or some other way how to get this info.


configure-proxy:
cmd.run:
- name: configure-proxy.sh --rhn-user={{ grains.get('server_username') | default('admin', true) }} --rhn-password={{ grains.get('server_password') | default('admin', true) }} --non-interactive --answer-file /run/config-answers.txt
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 really valid only for sumaform. I do not think salt clients usually have server_username and server_password in their grains. Is this intentional? If so, readme should mention steps how to use this formula.

But IMO this should be part of form and passed as pillar.

@@ -0,0 +1,3 @@
description:
Enable and configure Proxy.
group: general_system_configuration
Copy link
Member

Choose a reason for hiding this comment

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

Nitpick: maybe we can have special group for this. Unfortunately formula group names are not product translated, so ${productName} will not work, but something like SUSE Manager ecosystem or Uyuni one.

@mbussolotto
Copy link
Member Author

Thanks @aaannz , I'll try to address all these things on next learning tuesday ;)

@mbussolotto mbussolotto reopened this Jan 27, 2023
@mbussolotto mbussolotto changed the title Hackweek - Configure proxy formula WIP: Hackweek - Configure proxy formula Jan 27, 2023
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.

3 participants