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

manage_apt is true by default and non-configurable, preventing configuration of puppetlabs/apt

Open olifre opened this issue 7 years ago • 2 comments

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 5.5.2 (AIO package)
  • Distribution: Ubuntu 18.04 (Bionic)
  • Module version: v6.3.1-rc0

How to reproduce (e.g Puppet code you use)

Include any class like zabbix-agent / zabbix-server etc. and specify manage_repo => true.

What are you seeing

I can not define class { '::apt': } anywhere else, which means I can not configure it at all anymore. Otherwise, I get a duplicate definition! Reason is: https://github.com/voxpupuli/puppet-zabbix/blob/a03bb92975fc1350fa74a49e2c78c7316c2f6bcf/manifests/repo.pp#L91 i.e. puppet-zabbix includes apt if manage_apt is set. Sadly, manage_apt can not be configured unless hiera is used.

What behaviour did you expect instead

manage_apt to be off by default and necessity to include apt before is documented, as all other puppetlabs / voxpopuli modules handle this. Alternatively, at least possibility to configure manage_apt without hiera.

olifre avatar May 27 '18 15:05 olifre

I'm now using the following workaround:

	unless defined(Class['Zabbix::Repo']) {
		class { '::zabbix::repo':
			manage_repo	=> true,
			zabbix_version	=> $zabbix_version,
			manage_apt	=> false,
		}
	}
        class { 'zabbix::agent':
            ......
            zabbix_version	=> $zabbix_version,
            manage_repo		=> true,
            require		=> Class['Zabbix::Repo'],
        }

That helps, but of course that's a nasty hack.

olifre avatar May 27 '18 15:05 olifre

#330

juniorsysadmin avatar May 28 '18 12:05 juniorsysadmin