-
Notifications
You must be signed in to change notification settings - Fork 13
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
add --hosts param #111
add --hosts param #111
Conversation
Is |
4016fb5
to
8eb5755
Compare
8eb5755
to
bb316c1
Compare
It is starting to look like using a hostname prefix is a PITA for writing tests. It might be necessary to completely override the hostname. |
The "host" matching doesn't seem to be purely literal as this is working locally for me: # server/replica is only supported on Redhat
if fact_on('master', 'os.family') == 'RedHat'
describe 'easy_ipa class' do
include_examples 'the example', 'master.pp', 'master'
end
end
if fact_on('client', 'os.family') == 'RedHat'
describe 'easy_ipa class' do
include_examples 'the example', 'client.pp', 'client'
end
end with: BEAKER_destroy=no BEAKER_setfile=almalinux9-64{hostname=master-almalinux9-64.example.com}-almalinux9-64{hostname=client-almalinux9-64.example.com} BEAKER_PUPPET_COLLECTION=puppet7 bundle exec rake beaker |
bb316c1
to
dc193ac
Compare
I've renamed |
5191bb1
to
7b2a3ef
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall it looks good. Some small nit picks about style.
domain ||= 'example.com' if use_fqdn | ||
|
||
options = {} | ||
options[:hostname] = "#{hostname}.#{domain}" if domain | ||
if domain | ||
options[:hostname] = "#{shostname}.#{domain}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps bring the shostname
declaration to within this block?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that shouldn't break any of the existing tests but I suspect the logic here is wrong... the hostname should be set even when there isn't a domain component.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably makes more sense but would require updating 5 existing tests:
diff --git a/lib/puppet_metadata/beaker.rb b/lib/puppet_metadata/beaker.rb
index bdf3955..e5b38cf 100644
--- a/lib/puppet_metadata/beaker.rb
+++ b/lib/puppet_metadata/beaker.rb
@@ -63,7 +63,7 @@ module PuppetMetadata
aos = adjusted_os(os)
name = "#{aos}#{release.tr('.', '')}-64"
- shostname = if hostname
+ full_hostname = if hostname
hostname
elsif !puppet_version.nil?
"#{name}-#{puppet_version}"
@@ -72,12 +72,11 @@ module PuppetMetadata
end
domain ||= 'example.com' if use_fqdn
+ full_hostname += ".#{domain}" if domain
options = {}
- if domain
- options[:hostname] = "#{shostname}.#{domain}"
- elsif hostname
- options[:hostname] = hostname
+ if full_hostname != name
+ options[:hostname] = full_hostname
end
# Docker messes up cgroups and some systemd versions can't deal with
However, I'm leaning towards leaving it alone as I feel like a bigger picture rethink might be called for.
bca1b75
to
f89cb24
Compare
Before I was directed to this PR, I spent some time today hacking away myself. To support some of the existing use cases some way of assigning roles would be helpful. But it starts to become a bit difficult to support everything in a single command line option with loads of different delimiters needed. I think with the eg maybe Did you have specific vox modules or other use-cases in mind? (The ones I came across were |
f89cb24
to
378a598
Compare
@alexjfisher My initial use case was acceptance testing for freeipa with coverage of a replica server and a client. lsst-it/puppet-ipa#3 This is a fork of https://forge.puppet.com/modules/puppetfinland/easy_ipa/readme after upstream removed the vox module plumbing. I would be more than happy to contribute this mod to vox... I intentionally implemented the absolute minimum viable feature to get acceptance testing to run, in that server/replica/client can be tested for the same OS. There clearly needs to be more complicated configuration for mix role/os. As in freeipa server is only packaged for ELx these days. So it would be nice to be able to test EL9 servers with a Debian client. I think what is needed is the ability to configure a matrix of roles:os combos. |
Since #124 is merged now, I'm going to close this. |
Related to:
with
values for beaker.yml workflow modulesync_config#858