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

Allow for installing packages from UNC paths on Windows #113

Merged
merged 2 commits into from
May 26, 2017

Conversation

natemccurdy
Copy link
Contributor

This PR incorporates commits that ultimately allow Windows agents to install packages from UNC paths.

Prior to this, if setting $package_source to a UNC path on Windows, the package resource wouldn't ever use the value of $package_source as it's source. The reason for that is because a UNC path doesn't need to be staged with staging::file thus the $pkg_source variable was never set.

While I was fixing that problem, I also cleaned up the variable names in the staging::file steps to make their intent more clear.

Prior to this, if a custom forwarder or splunk package source was
supplied to the package_source parameter and that package did not
need to be staged (because we're targetting an MSI on a UNC path
for example), the package installation would fail with a message
like:

  source is required when using package provider 'windows'

The reason it failed is because the $package_source variable was not
being used as the source of the package. Instead, the
$pkg_source variable is used. $pkg_source is only created if
the file needs to be staged; which in the case of using Windows and a
UNC package source, it does not.

This fixes the problem by using the pick() function to choose either
$pkg_source or $package_source (in that order) as the source of the
package.
Prior to this, the names of the variables used to stage the Splunk
Forwarder and Server package were not very clear or descriptive. This
commit hopes to clear that up by renaming the variables to better
describe their purpose and not have names that conflict with other
variable's purposes.
@bastelfreak bastelfreak added the bug Something isn't working label May 26, 2017
@bastelfreak
Copy link
Member

Thanks!

@bastelfreak bastelfreak merged commit 295f074 into voxpupuli:master May 26, 2017
@natemccurdy natemccurdy deleted the fix_package_source branch May 27, 2017 00:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants