Quantcast
Channel: Java mon amour
Viewing all articles
Browse latest Browse all 1121

Puppet. generate a property file from a YAML hash

$
0
0
the YAML:


acmev2_properties:
acmev2_env : DEV
acmev2_loadbalancerurl : http://hqchacme102.acme.com:8001/



The file/template statenent:

file { "${acmescripts_rootfolder}config/acmeconfig.properties":
ensure => present,
content => template('acmev2/acmescripts/acmeconfig.properties.erb'),
mode => 0775,
}


The acmeconfig.properties.erb template file:


<% @acmev2_properties.each do |key, value| -%>
<%= key %>=<%= value %>
<% end -%>



The generated property file:


acmev2_env=DEV
acmev2_loadbalancerurl=http://hqchacme102.acme.com:8001/

Viewing all articles
Browse latest Browse all 1121

Trending Articles