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

Replace staging module with archive module #128

Merged
merged 3 commits into from
Sep 23, 2017
Merged

Replace staging module with archive module #128

merged 3 commits into from
Sep 23, 2017

Conversation

TraGicCode
Copy link
Contributor

@TraGicCode TraGicCode commented Sep 13, 2017

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?

@TraGicCode
Copy link
Contributor Author

I Still need to test this on windows and other nodes besides ubuntu. Just need a set of eyes to look at this.

@wyardley
Copy link
Contributor

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?

@@ -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
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

wyardley
wyardley previously approved these changes Sep 13, 2017
Copy link
Contributor

@wyardley wyardley left a 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
Copy link
Member

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

Copy link
Contributor Author

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

image

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

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 ??

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Member

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 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -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')
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@@ -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
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@TraGicCode
Copy link
Contributor Author

TraGicCode commented Sep 14, 2017

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:

  • See if puppet-archive will allow downloading a file without requiring 7zip and chocolatey

@alexjfisher
Copy link
Member

If you're not needing to extract anything you download, I don't see why you'd need to include ::archive. (You would then need to create and use your own 'staging' path though).

Copy link
Contributor

@wyardley wyardley left a 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)?

@@ -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')
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No Longer applicable

@wyardley wyardley dismissed their stale review September 14, 2017 19:06

dismissing in favor of @alexjfisher's comments

@TraGicCode
Copy link
Contributor Author

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 )
Windows ( only forwarder..looks like server has never worked )


# Install modules and dependencies
puppet_module_install(source: proj_root, module_name: 'splunk')
shell('puppet module install puppet-archive --version 2.0.0')
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bastelfreak Done.

@@ -0,0 +1,27 @@
require 'rspec-system/spec_helper'
Copy link
Member

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

Copy link
Contributor Author

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@TraGicCode
Copy link
Contributor Author

I believe i've cleared up all of the raised issues

@bastelfreak
Copy link
Member

@TraGicCode looks good to me. @alexjfisher can you check this PR again?

@alexjfisher alexjfisher merged commit c732f38 into voxpupuli:master Sep 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants