Fixes 38993: add OpenVox repository#10816
Conversation
5ec550b to
36ac7b9
Compare
bastelfreak
left a comment
There was a problem hiding this comment.
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')) -%> |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
And, is there a way to add tests to templates?
There was a problem hiding this comment.
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-puppetandforce-openvoxare 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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
We use factory_bot which has its own documentation: https://thoughtbot.github.io/factory_bot/
There was a problem hiding this comment.
Also, in #9516 there's some work to clean up the factories and make them more extensible..
There was a problem hiding this comment.
Thanks, I am implementing Debian/Ubuntu tests and just discovered it doesn't work
There was a problem hiding this comment.
@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?
318804e to
c80a5b2
Compare
Add OpenVox repository when relevant parameters are in use.
c80a5b2 to
62c80b9
Compare
ekohl
left a comment
There was a problem hiding this comment.
I think this is starting to look very good.
| - | | ||
| <%= indent(2) { snippet('chef_client') } %> | ||
| <% end -%> | ||
| <% if openvox_enabled -%> |
There was a problem hiding this comment.
I'd like to prevent the case where both Vox and Puppet repos are enabled so perhaps this can be:
- if
openvox_enabled→snippet('voxpupuli_repo') - else if
puppet_enabled→snippet('puppetlabs_repo') - if
openvox_enabledorpuppet_enabled→snippet('puppet_setup')
That probably needs some redefinition of puppet_enabled
There was a problem hiding this comment.
Ok, I'll try after Fosdem/CfgMgmtCamp
Add OpenVox repository when relevant parameters are in use.