puppet-zabbix icon indicating copy to clipboard operation
puppet-zabbix copied to clipboard

zabbix::userparameters source & script, remove "Stdlib::Filesource" type

Open sfuerte opened this issue 6 years ago • 4 comments
trafficstars

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

sfuerte avatar Dec 21 '18 19:12 sfuerte

Hi @sfuerte, thanks for bringing this up. Are you able to provide a PR for this module to fix this?

bastelfreak avatar Dec 21 '18 23:12 bastelfreak

@bastelfreak PR to stdlib needed probably?

alexjfisher avatar Dec 22 '18 23:12 alexjfisher

That would be the longterm fix, yes. But I don't expect that we get fast releases for stdlib.

bastelfreak avatar Dec 23 '18 00:12 bastelfreak

@bastelfreak A temporary fix in this module would make sense. Meanwhile, I've opened https://github.com/puppetlabs/puppetlabs-stdlib/pull/981

alexjfisher avatar Dec 23 '18 13:12 alexjfisher