Icinga / puppet-icinga2-legacy

(legacy) Puppet module for Icinga 2 (EOL)
GNU General Public License v2.0
55 stars 93 forks source link

[dev.icinga.com #9148] Hiera should be used outside the module #328

Open icinga-migration opened 9 years ago

icinga-migration commented 9 years ago

This issue has been migrated from Redmine: https://dev.icinga.com/issues/9148

Created by arioch on 2015-04-21 22:13:07 +00:00

Assignee: (none) Status: New Target Version: 1.0.0 Last Update: 2016-01-13 00:48:52 +00:00 (in Redmine)


If we ever want to get this module Puppetlabs approved we need to move Hiera outside the module.

All this needs to be refactored:

$ grep -ri 'hiera_' .
./manifests/objects.pp:  $hash_apply_dependency = hiera_hash('icinga2::object::apply_dependency',undef)
./manifests/objects.pp:  $hash_apply_notification_to_host = hiera_hash('icinga2::object::apply_notification_to_host',undef)
./manifests/objects.pp:  $hash_apply_notification_to_service = hiera_hash('icinga2::object::apply_notification_to_service',undef)
./manifests/objects.pp:  $hash_apply_service_to_host = hiera_hash('icinga2::object::apply_service_to_host',undef)
./manifests/objects.pp:  $hash_checkcommand = hiera_hash('icinga2::object::checkcommand',undef)
./manifests/objects.pp:  $hash_dependency = hiera_hash('icinga2::object::dependency',undef)
./manifests/objects.pp:  $hash_eventcommand = hiera_hash('icinga2::object::eventcommand',undef)
./manifests/objects.pp:  $hash_graphitewriter = hiera_hash('icinga2::object::graphitewriter',undef)
./manifests/objects.pp:  $hash_hostgroup = hiera_hash('icinga2::object::hostgroup',undef)
./manifests/objects.pp:  $hash_host = hiera_hash('icinga2::object::host',undef)
./manifests/objects.pp:  $hash_idomysqlconnection = hiera_hash('icinga2::object::idomysqlconnection',undef)
./manifests/objects.pp:  $hash_idopgsqlconnection = hiera_hash('icinga2::object::idopgsqlconnection',undef)
./manifests/objects.pp:  $hash_notificationcommand = hiera_hash('icinga2::object::notificationcommand',undef)
./manifests/objects.pp:  $hash_notification = hiera_hash('icinga2::object::notification',undef)
./manifests/objects.pp:  $hash_perfdatawriter = hiera_hash('icinga2::object::perfdatawriter',undef)
./manifests/objects.pp:  $hash_scheduleddowntime = hiera_hash('icinga2::object::scheduleddowntime',undef)
./manifests/objects.pp:  $hash_servicegroup = hiera_hash('icinga2::object::servicegroup',undef)
./manifests/objects.pp:  $hash_service = hiera_hash('icinga2::object::service',undef)
./manifests/objects.pp:  $hash_timeperiod = hiera_hash('icinga2::object::timeperiod',undef)
./manifests/objects.pp:  $hash_usergroup = hiera_hash('icinga2::object::usergroup',undef)
./manifests/objects.pp:  $hash_user = hiera_hash('icinga2::object::user',undef)

Attachments


Relations:

icinga-migration commented 8 years ago

Updated by mfrosch on 2015-12-11 09:48:44 +00:00

icinga-migration commented 8 years ago

Updated by mfrosch on 2015-12-11 09:49:27 +00:00

We could move the create_resources over to a icinga2::object class, which should auto-bind the params from hiera.

icinga-migration commented 8 years ago

Updated by ziaunys on 2016-01-13 00:48:52 +00:00

lazyfrosch wrote:

We could move the create_resources over to a icinga2::object class, which should auto-bind the params from hiera.

The only problem with doing that is that it wouldn't have the same behavior as using hiera_hash since it actually does a merge of hashes from various levels of the hierarchy. I'm honestly of the opinion that we should delete the icinga2::objects class because if users want to use create_resources and hiera_hash they can do it in the context of a profile. I'm not convinced this class provides a whole lot of value.