I found a solution:
<%- | String $database_schemes,
Hash[String, Hash[String, String]] $database_conf,
| -%>
DATABASES=<%= $database_schemes %>
<% $database_conf.keys.sort.each |$key| { -%>
##################################################
<%= $key %>.jdbc.DRIVER=<%= $database_conf[$key]['oracle_cms_jdbc_driver']
%>
<% } -%>
Andreas Dvorak schrieb am Donnerstag, 10. September 2020 um 08:10:26 UTC+2:
> Hi,
>
> I have this structure in hiera and want to use it in a inlined-epp file
>
>
>
>
>
>
>
>
>
>
>
> *cms::params::database_conf: 'oracle_cms_dev': oracle_cms_jdbc_schema:
> 'CMS_DEV' oracle_cms_jdbc_user: 'CMS_DEV' oracle_cms_jdbc_driver:
> 'oracle.jdbc.OracleDriver' oracle_cms_jdbc_url: 'jdbc:oracle:thin:....)'
> 'oracle_cms_dev2': oracle_cms_jdbc_schema: 'CMS_DEV2'
> oracle_cms_jdbc_user: 'CMS_DEV2' oracle_cms_jdbc_driver:
> 'oracle.jdbc.OracleDriver' oracle_cms_jdbc_url: 'jdbc:oracle:thin:*
>
> code in the class
> $vault_vars_jdbc = {
> 'database_conf' => $cms::params::database_conf,
> }
>
> epp file
> <%- |
> Hash database_conf,
> | -%>
>
> But I get the error:
> Error: Failed to apply catalog: inline_epp(): Invalid EPP: Syntax error at
> 'database_conf' (file: inlined-epp-text, line: 2, column: 11)
>
> So "Hash" does not work. Can somebody please help me?
>
> Regards,
> Andreas
>
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/2c1244b6-e43d-4036-8ff6-95b0ca9c3886n%40googlegroups.com.