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

Add support to rsync fixtures into SUTs #49

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bastelfreak
Copy link
Member

No description provided.

@bastelfreak bastelfreak self-assigned this Sep 3, 2024
@bastelfreak bastelfreak marked this pull request as ready for review September 3, 2024 14:42
@bastelfreak bastelfreak added the enhancement New feature or request label Sep 3, 2024
Co-authored-by: Ewoud Kohl van Wijngaarden <[email protected]>
# The directory where the modules sit
# @param [String] destination
# The directory where the modules will be placed
def install_puppet_modules_via_rsync(hosts, source = 'spec/fixtures/modules/', destination = '/etc/puppetlabs/code/environments/production/modules')
Copy link
Member

Choose a reason for hiding this comment

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

Normally we try to use settings. If you do, you probably can't use the rsync_to helper and your code looks more as it did in the previous version. Just make it destination = nil and if nil, read the value from Puppet's settings. I don't think we have a helper for that (anymore).

It probably comes down to using puppet config print environmentpath and puppet config print environment to determine the destination. That should also help with non-standard configurations.

I also wonder if there should be a default for source because I think making a mandatory parameter is better. That way users of the API are forced to think about it.

Another thought: in foreman-infra we use environment.conf to load multiple directories with modules. In my design I kept module vs repo testing separate. For voxpupuli-acceptance is the tooling intended to make individual module testing easy. This library should make testing Puppet easy. That sort of makes an argument for it to be in voxpupuli-acceptance.

Copy link
Member Author

Choose a reason for hiding this comment

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

My idea was that this helper method isn't Vox Pupuli specific so I added it here and not in voxpupuli-acceptance. I applied the defaults that we/beaker sets during tests at the moment. Let me know if you prefer it in voxpupuli-acceptance and I can move it.

Copy link
Member

Choose a reason for hiding this comment

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

My feeling now is that the implementation is so trivial. However, if you are smarter and read the destination from Puppet's config on the target machine then it certainly makes sense.

At this moment I'm a bit unsure what's best.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants