Quantcast
Channel: Ask Puppet: Puppet DevOps Q&A Community - RSS feed
Viewing all articles
Browse latest Browse all 6104

Duplicate declaration error when using Ini_setting

$
0
0
I'm getting this error when using ini_setting and hiera "Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Evaluation Error: Error while evaluating a Function Call, Duplicate declaration: Ini_setting[[database] connection] is already declared; cannot redeclare at /etc/puppetlabs/code/environments/production/manifests/site.pp:50:3 on node lib-glance.liberty.local" I know why i am getting the error, here is my puppet code node 'lib-glance' { include glance::api include glance::registry } class glance::api ($settings,){ # validate_hash($apisettings) $defaults = { 'path' => '/etc/glance/glance-api.conf' } create_ini_settings($settings, $defaults) } class glance::registry($settings,){ # validate_hash($registrysettings) $regdefaults = { 'path' => '/etc/glance/glance-registry.conf' } create_ini_settings($settings, $regdefaults) } And here is the associated heira glance::api::settings: DEFAULT: notification_driver: "noop" verbose: "true" database: connection: "mysql://glance:%{hiera('databasePasswords::glance')}@%{hiera('mysql::virtualIP')}/glance" glance::registry::settings: database: connection: "mysql://glance:%{hiera('databasePasswords::glance')}@%{hiera('mysql::virtualIP')}/glance Clearly when the second `create_ini_settings` runs it is detects the duplicate variable definition from the database \ Connection setting and throws an error. But my intention is to write these values into separate config files(This works if i remove the duplication). So how do I fix this?

Viewing all articles
Browse latest Browse all 6104

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>