Details
-
Bug
-
Status: Resolved
-
Normal
-
Resolution: Fixed
-
PUP 4.10.0, PUP 5.5.6
-
None
-
Coremunity
-
Platform Core KANBAN
-
Needs Assessment
-
Bug Fix
-
Puppet now preserves query parameters when retrieving file metadata and content for http/https file resources.
-
Needs Assessment
Description
Puppet Version: 4.4.0 - 5.5.6
Puppet Server Version: All
OS Name/Version: All
We want to use the `source` attribute of the file type to get host specific stuff from a web service. For this we're using the following code:
file { '/etc/path/to/file': |
ensure => file, |
source => 'https://fancywebservice.example.org/get_host_specific_config.py?host=foobar' |
}
|
The important part here is the `host=foobar` parameter. If it's not added, the web service will return a 404.
Desired Behavior:
The file type should be able to retrieve a file from a http(s) URL which contains query parameters
Actual Behavior:
Error: /Stage[main]/Main/File[/etc/path/to/file]: Could not evaluate: Could not retrieve information from environment production source(s) https://fancywebservice.example.org/get_host_specific_config.py?host=foobar
|
This happens, because Puppet, for reason unknown to me, requests only the `path` element of the uri and skips on the query parameters:
I will submit a PR to fix this.