Skip to content
This repository has been archived by the owner on Sep 24, 2019. It is now read-only.

Support for Puppet 5 or what new helper should be used? #33

Open
vinzent opened this issue Jul 2, 2017 · 5 comments
Open

Support for Puppet 5 or what new helper should be used? #33

vinzent opened this issue Jul 2, 2017 · 5 comments

Comments

@vinzent
Copy link

vinzent commented Jul 2, 2017

At VoxPupuli the beaker tests use the puppet_install_helper method.

It's not possibile to declare PUPPET_INSTALL_VERSION=5.0.0 right now. Reading https://github.com/puppetlabs/beaker-puppet_install_helper/blob/master/CONTRIBUTING.md it seems like this is deprecated.

What is the puppet beaker rspec way to test with the new Puppet 5?

@vinzent
Copy link
Author

vinzent commented Jul 2, 2017

follow ups:

@hunner
Copy link
Contributor

hunner commented Mar 23, 2018

Looks like that's merged. We've been out of it for a while, but BPIH should definitely get puppet5 abilities... just in time for puppet 6 :D.

This isn't deprecated... it's still the de facto interface for doing a basic puppet install for acceptance testing with minimal fuss.

@melissa
Copy link
Contributor

melissa commented Oct 3, 2018

I am personally not a huge fan of BPIH because it's yet another layer on top of a lot of layers. However, BPIH does have puppet5 capabilities.

The install type (PUPPET_INSTALL_TYPE) needs to be agent. You should set BEAKER_PUPPET_COLLECTION to the collection you want (i.e., puppet5, puppet6-nightly, puppet, etc.). You'll want to make sure both BEAKER_PUPPET_AGENT_SHA and PUPPET_AGENT_SHA are unset, because that will try to use automation that is geared toward our internal setup.

The above set up will end up calling a method defined in beaker-puppet. However, looking at this, it looks like we need to modify BPIH a bit to pass in at least puppet_collection (this should just take from BEAKER_PUPPET_COLLECTION) and optionally one of puppet_agent_version or version, unless those are already in the options hash and I just missed it. So this may or may not be broken, I'll have to dig a little more to answer that fully. Regardless, if those vars are getting passed in, then it will install the package from on of the urls we define at https://github.com/puppetlabs/beaker-puppet/blob/master/lib/beaker-puppet/install_utils/foss_defaults.rb#L10-L21. BPIH does override some of those defaults at https://github.com/puppetlabs/beaker-puppet_install_helper/blob/master/lib/beaker/puppet_install_helper.rb#L88-L93.

@vinzent I hope that helps a bit. Please feel free to reach out if you have any questions or ping me in the puppet community slack

@hunner
Copy link
Contributor

hunner commented Oct 4, 2018

it seems like this [PUPPET_INSTALL_VERSION] is deprecated.

Yeah! Beaker got a lot more variables since BPIH was written so BPIH variables (starting with PUPPET_*) were deprecated in favor of beaker equivalents (starting with BEAKER_*).

I am personally not a huge fan of BPIH because it's yet another layer on top of a lot of layers. However, BPIH does have puppet5 capabilities.

It was always the intention that BPIH should only ever "exist to provide the most user-friendly interface for getting puppet installed and working so that module tests can proceed" since beaker had way too many knobs or missing knobs back when it was created. It was even stated that BPIH is "definitely going away" in https://github.com/puppetlabs/beaker-puppet_install_helper/blob/master/CONTRIBUTING.md#contributing-and-adding-features . But you know what they say about temporary hacks...

The install type (PUPPET_INSTALL_TYPE) needs to be agent.

I think this was deprecated because beaker's BEAKER_PUPPET_COLLECTION takes the place of that and it doesn't need to be set to anything, actually.

Try BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_PUPPET_AGENT_VERSION=5.0.0 as these are the two beaker (not BPIH) variables to make this happen.

@melissa
Copy link
Contributor

melissa commented Oct 4, 2018

The install type (PUPPET_INSTALL_TYPE) needs to be agent.

I think this was deprecated because beaker's BEAKER_PUPPET_COLLECTION takes the place of that and it doesn't need to be set to anything, actually.

I'm not so sure, judging from the code. If you pass the type in to run_puppet_install_helper_on or run_puppet_install_helper, then you don't need it. Otherwise, type is set via the find_install_type method:

def find_install_type
# XXX Just use default.is_pe? when PUPPET_INSTALL_TYPE=foss is removed.
ENV['PUPPET_INSTALL_TYPE'] || if default.is_pe?
'pe'
else
'agent'
end
end

edit: derp, looking at that code more closely, it'll default to agent as long as default.is_pe? doesn't return true. Looks like you definitely are right @hunner !!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants