puppet-zabbix
puppet-zabbix copied to clipboard
zabbix::userparameters source & script, remove "Stdlib::Filesource" type
Not sure why it was introduced in 95dc9b21, but it limits the usage significantly, as the path can be only:
- Stdlib::Absolutepath,
- Stdlib::HTTPUrl,
- /^file:///([^/\0]+(/)?)+$/,
- /^puppet://(([\w-]+.?)+)?/modules/([^/\0]+(/)?)+$/, (see https://github.com/puppetlabs/puppetlabs-stdlib/blob/master/types/filesource.pp)
The issue arises when there is a specific mount points (as per https://puppet.com/docs/puppet/6.1/file_serving.html) in Puppet, e.g. /etc/puppetlabs/puppet/fileserver.conf:
[my_storage]
path /etc/puppetlabs/my_storage/
allow *
Then I can access it with simple puppet:///my_storage/..., for example (in Hiera):
zabbix::userparameter::data:
ntp:
source: 'puppet:///my_storage/zabbix/zabbix_agentd.d/ntp.conf'
Benefits of such approach:
- network accessible from central location
- no need to know the full URL (
Stdlib::HTTPUrl) - module independent (
puppet:///modules/zabbix/...would work but then it's a hassle to upgrade the module every single time)
PS: though raised a FR for Stdlib as well, https://tickets.puppetlabs.com/browse/MODULES-8404
Hi @sfuerte, thanks for bringing this up. Are you able to provide a PR for this module to fix this?
@bastelfreak PR to stdlib needed probably?
That would be the longterm fix, yes. But I don't expect that we get fast releases for stdlib.
@bastelfreak A temporary fix in this module would make sense. Meanwhile, I've opened https://github.com/puppetlabs/puppetlabs-stdlib/pull/981