Skip to content

Instantly share code, notes, and snippets.

@mrzarquon
Created May 3, 2019 02:48
Show Gist options
  • Save mrzarquon/172f8f84cc1dd217a646c3fc68e09d80 to your computer and use it in GitHub Desktop.
Save mrzarquon/172f8f84cc1dd217a646c3fc68e09d80 to your computer and use it in GitHub Desktop.
puppet hash to yaml file
$config_hash = {
'hosts' => $hosts.sort(),
'metrics_type' => $metrics_type,
'metrics_port' => $metrics_port,
'additional_metrics' => $additional_metrics,
'clientcert' => $::clientcert,
'pe_version' => $facts['pe_server_version'],
'ssl' => $ssl,
}
file { "${scripts_dir}/${metrics_type}_config.yaml" :
ensure => $metric_ensure,
mode => '0644',
content => $config_hash.puppet_metrics_collector::to_yaml(),
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment