-
Notifications
You must be signed in to change notification settings - Fork 115
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
prepare puppet classes needed for FAM tests in setup_fam #16728
prepare puppet classes needed for FAM tests in setup_fam #16728
Conversation
84e1f22
to
85d750f
Compare
b84e2f1
to
dc23b5a
Compare
dc23b5a
to
d22ba4f
Compare
) | ||
smart_proxy.import_puppetclasses() | ||
|
||
create_fake_module(module_target_sat, 'fakemodule', ['init']) |
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.
One could argue this should rather happen inside test_positive_run_modules_and_roles
when testing the puppetclasses_import
module.
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.
Looks alright to me, left small nitpick.
d22ba4f
to
b9c24a8
Compare
f'puppet module install --ignore-dependencies {local_path}/{module_tarball}' | ||
) | ||
|
||
def create_fake_module(module_target_sat, module_name, module_classes): |
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.
Jameer asked via Slack what's exactly happening here, and I think we can write it down here in the PR for anyone who will come back and read it later:
I need puppet modules for the tests. 1/ the prometheus module (with those exporter subclasses) and 2/ "some rando module, just something that can be imported"
in both cases, I don't actually care about them to have any working puppet code in them, as long as the names (of modules/classes) are as I want them to
a trivial Puppet class definition is:
class some_name(){
}
or also
class some_name(){}
if I want to ignore newlines/readability
so the code (create_fake_module
) goes and given the name of a module (e.g. prometheus
) and classes inside that module (e.g. ['init', 'haproxy_exporter', 'redis_exporter', 'statsd_exporter']
) it:
- creates the folder where these files would live (
/etc/puppetlabs/code/environments/production/modules/prometheus/manifests
) (and it's parents,mkdir -p
does that for us) - in this folder it creates "empty" class files, an
init.pp
withclass prometheus(){}
, ahaproxy_exporter.pp
withclass prometheus::haproxy_exporter(){}
, etc…
For Puppet/Foreman this looks like totally legit normal Puppet modules, they can be imported into Foreman and applied to Hosts/Hostsgroups, and that's all we care about
(cherry picked from commit 3b5cfa0)
(cherry picked from commit 3b5cfa0)
(cherry picked from commit 3b5cfa0)
…6762) prepare puppet classes needed for FAM tests in setup_fam (#16728) (cherry picked from commit 3b5cfa0) Co-authored-by: Evgeni Golov <[email protected]>
…6760) prepare puppet classes needed for FAM tests in setup_fam (#16728) (cherry picked from commit 3b5cfa0) Co-authored-by: Evgeni Golov <[email protected]>
…6763) prepare puppet classes needed for FAM tests in setup_fam (#16728) (cherry picked from commit 3b5cfa0) Co-authored-by: Evgeni Golov <[email protected]>
Problem Statement
host
andhostgroup
tests)puppetclasses_import
test)puppet module install <module>
requires access to Puppet Forge, which might or might not be present during thefam-test-setup
workflowSolution
fam-test-setup
workflow, move the whole setup torobottelo
puppetlabs-ntp
from https://github.com/SatelliteQE/fedorapeople-repos/, as we use parameters from that module to test parameter assignmentpuppet-prometheus
as we don't use anything of the module, just the fact that the classes are presentfakemodule
that can be imported when the tests run.Example