-
-
Notifications
You must be signed in to change notification settings - Fork 124
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
Replace staging module with archive module #128
Replace staging module with archive module #128
Conversation
I Still need to test this on windows and other nodes besides ubuntu. Just need a set of eyes to look at this. |
Can you suppress the merge (rebasing is better), and squash it down into either 1 commit or a few commits that are broken up into logical functions. Did you run the acceptance tests yet? |
manifests/params.pp
Outdated
@@ -80,7 +80,7 @@ | |||
# Based on the small number of inputs above, we can construct sane defaults | |||
# for pretty much everything else. | |||
|
|||
# Settings common to everything | |||
# # Settings common to everything |
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.
Is the extra comment mark a mistake here?
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.
Yes. Was when i was commenting out staging to get everything to fail and then replace it
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.
Done
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 Ok to me, other than the extra comment mark. I'd like it if someone who's more familiar with this module could also review, though.
include ::splunk::params | ||
include ::splunk::platform::posix | ||
|
||
$path = $staging::path | ||
$path = $archive::path |
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.
There's no such variable as $archive::path
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.
Hey @alexjfisher It does work but i might be accessing this the wrong way from the puppet archive 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.
My mistake. I missed the inherits
https://github.com/voxpupuli/puppet-archive/blob/master/manifests/init.pp#L28
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.
The staging module created $staging::path for you. With archive, I think you'll need to include ::archive::staging
instead of just ::archive
??
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.
Done.
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.
Also needed in forwarder.pp
?
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.
Done
spec/spec_helper_system.rb
Outdated
@@ -19,7 +19,7 @@ | |||
|
|||
# Install modules and dependencies | |||
puppet_module_install(source: proj_root, module_name: 'splunk') | |||
shell('puppet module install nanliu-staging --version 0.3.1') | |||
shell('puppet module install puppet-archive --version 0.3.1') |
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.
There's no such version of puppet/archive.
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.
Done.
manifests/forwarder.pp
Outdated
@@ -73,16 +73,16 @@ | |||
$path_delimiter = $splunk::params::path_delimiter | |||
#no need for staging the source if we have yum or apt | |||
if $pkg_provider != undef and $pkg_provider != 'yum' and $pkg_provider != 'apt' and $pkg_provider != 'chocolatey' { | |||
include ::staging | |||
include ::archive |
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.
include ::archive::staging
here too?
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.
Done.
Before this can be merged there is one thing that will break all existing windows users that don't have chocolatey. Briefly looking, by default, it looks like the archive class in the archive module assumes the user has 7zip installed and if not it will install it via chocolatey. Therefore i need to do the following:
|
If you're not needing to extract anything you download, I don't see why you'd need to |
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.
I think spec_helper_system.rb and any related plumbing can probably be removed outright (in a separate PR, if not here)?
spec/spec_helper_system.rb
Outdated
@@ -19,7 +19,7 @@ | |||
|
|||
# Install modules and dependencies | |||
puppet_module_install(source: proj_root, module_name: 'splunk') | |||
shell('puppet module install nanliu-staging --version 0.3.1') | |||
shell('puppet module install puppet-archive --version 2.0.0') |
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.
btw, it seems like this is for https://github.com/puppetlabs/rspec-system, which is deprecated and presumably not in use now that the module has beaker based acceptance tests
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.
No Longer applicable
dismissing in favor of @alexjfisher's comments
I tested on windows and it looks like that block never executes that uses the archive module. If you pass in a folder location where the msi exists it will use that existing file to install the forwarder. If you pass in an HTTP/S url the package resource will stream the msi and perform the install without ever saving the file on the windows system. @alexjfisher From what i can tell this should be good. Tested on Ubuntu 16.04 ( server and forwarder ) |
spec/spec_helper_system.rb
Outdated
|
||
# Install modules and dependencies | ||
puppet_module_install(source: proj_root, module_name: 'splunk') | ||
shell('puppet module install puppet-archive --version 2.0.0') |
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.
please take a look at the spec_helper_acceptance here:
voxpupuli/puppet-grafana@d09835a
install_module_dependencies installs all modules from the metadata.json, install_module_from_forge is for additional dependencies.
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.
After #136 is merged i can do this.
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.
@bastelfreak Done.
spec/spec_helper_system.rb
Outdated
@@ -0,0 +1,27 @@ | |||
require 'rspec-system/spec_helper' |
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.
I believe spec_helper_system.rb
is no longer used. Nowadays we only use spec_helper_acceptance.rb
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.
I'll get that as well.
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.
Done.
I believe i've cleared up all of the raised issues |
@TraGicCode looks good to me. @alexjfisher can you check this PR again? |
This will get rid of the staging module being used and replace it with the newer recommended archive module.
Closes #127
@wyardley Can you review this?