Skip to content

Fixes 38993: add OpenVox repository#10816

Open
d1nuc0m wants to merge 1 commit intotheforeman:developfrom
d1nuc0m:voxpupuli-repo
Open

Fixes 38993: add OpenVox repository#10816
d1nuc0m wants to merge 1 commit intotheforeman:developfrom
d1nuc0m:voxpupuli-repo

Conversation

@d1nuc0m
Copy link
Contributor

@d1nuc0m d1nuc0m commented Jan 14, 2026

Add OpenVox repository when relevant parameters are in use.

Copy link
Member

@bastelfreak bastelfreak left a comment

Choose a reason for hiding this comment

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

I haven't tested this, but the changes look correct to me

<%= snippet 'puppet_setup' %>
<% end -%>

<% if !host_param_true?('skip-openvox-setup') && (host_puppet_server.present? || host_param_true?('force-openvox')) -%>
Copy link
Member

Choose a reason for hiding this comment

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

I think this will mean it runs both Puppet and OpenVox setup. In app/views/unattended/provisioning_templates/user_data/userdata_default.erb you solved it with a force-puppet parameter and IMHO this part should be aligned.

Copy link
Contributor Author

@d1nuc0m d1nuc0m Jan 26, 2026

Choose a reason for hiding this comment

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

Thinking about it maybe it should be like this:

  • if Puppet is explicitly forced, install it
  • Otherwise, default to OpenVox (instead of Puppet) if a Puppet Server is present and OpenVox setup is not explicitly skipped; or if OpenVox setup is forced

Btw, which should be the proper way to add an exception in case both force-puppet and force-openvox are true?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And, is there a way to add tests to templates?

Copy link
Member

Choose a reason for hiding this comment

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

Thinking about it maybe it should be like this:

I think that's good

Btw, which should be the proper way to add an exception in case both force-puppet and force-openvox are true?

I'd also be OK with just assuming OpenVox then. In environments where Katello is used you control the availability via synced content anyway and it's irrelevant. You only need the configuration to be done.

And, is there a way to add tests to templates?

We render snapshots, so that can be used. It's a fairly heavy process though because it usually results in huge files to be included.

Copy link
Contributor Author

@d1nuc0m d1nuc0m Jan 27, 2026

Choose a reason for hiding this comment

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

I'd also be OK with just assuming OpenVox then

Ok, it should work like this now

We render snapshots, so that can be used. It's a fairly heavy process though

There isn't something like Rspec to render templates with variables and check if they contain/do not contain what's expected?

Copy link
Contributor Author

@d1nuc0m d1nuc0m Jan 28, 2026

Choose a reason for hiding this comment

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

Thanks, I tried to write a test based on your code and existing tests, where could I find some docs for FactoryBot.create? I'd like to add more OSes. Also, is the test part of the suite now or should I add it somewhere?

Copy link
Member

Choose a reason for hiding this comment

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

We use factory_bot which has its own documentation: https://thoughtbot.github.io/factory_bot/

Copy link
Member

Choose a reason for hiding this comment

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

Also, in #9516 there's some work to clean up the factories and make them more extensible..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, I am implementing Debian/Ubuntu tests and just discovered it doesn't work

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ekohl done, to add OSes like Ubuntu 24.04, it should be added to test/factories/operatingsystem.rb before? And, is it enough to place the voxpupuli repo test file in test/unit/foreman/templates/snippets or I should declare it somewhere?

@d1nuc0m d1nuc0m force-pushed the voxpupuli-repo branch 7 times, most recently from 318804e to c80a5b2 Compare January 28, 2026 13:30
Add OpenVox repository when relevant parameters are in use.
Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

I think this is starting to look very good.

- |
<%= indent(2) { snippet('chef_client') } %>
<% end -%>
<% if openvox_enabled -%>
Copy link
Member

Choose a reason for hiding this comment

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

I'd like to prevent the case where both Vox and Puppet repos are enabled so perhaps this can be:

  • if openvox_enabledsnippet('voxpupuli_repo')
  • else if puppet_enabledsnippet('puppetlabs_repo')
  • if openvox_enabled or puppet_enabledsnippet('puppet_setup')

That probably needs some redefinition of puppet_enabled

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I'll try after Fosdem/CfgMgmtCamp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants