User Tools

Site Tools


puppet

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
puppet [2018/08/07 10:55]
k2patel [External Links]
puppet [2019/03/07 09:53] (current)
k2patel [Puppet Dynamic values playground]
Line 41: Line 41:
 </​code>​ </​code>​
  
 +==== Puppet Dynamic values playground ====
  
 +=== EPP and passing values ===
 +<code ruby>
 +$template_parameters = {
 +   ​test ​ => $test1,
 +   test2 => $test::​test,​
 +   ​nice ​ => $works,
 +}
 +
 +content => epp('​vsftpd/​template.epp',​ $template_parameters),​
 +</​code>​
 +==== trimming values ====
 +Following can grab the last character from the hostname and convert to integer to avoid warning.
 +<code ruby>
 +$esnumber = inline_epp('<​%= Integer.new($::​hostname[-1,​1]) + 1 %>'​)
 +</​code>​
 ==== Checking Hiera Value ==== ==== Checking Hiera Value ====
 **Trying to lookup vhostip value** **Trying to lookup vhostip value**
Line 310: Line 326:
 psql puppetdb -c '​create extension pg_trgm';​ psql puppetdb -c '​create extension pg_trgm';​
 </​code>​ </​code>​
 +
 +=== Mapping values ===
 +<code ruby>
 +<%- $ips = $vs_map[$name].map |$val| { $val['​address'​]['​ip'​] } -%>
 +</​code>​
 +
  
 ==== External Links ==== ==== External Links ====
Line 318: Line 340:
  
 [[ https://​groups.google.com/​group/​puppet-users/​browse_thread/​thread/​e56e0f678a134089 | Incremental Number ]] [[ https://​groups.google.com/​group/​puppet-users/​browse_thread/​thread/​e56e0f678a134089 | Incremental Number ]]
 +
 +[[ https://​github.com/​jessereynolds/​puppet_certificate_extensions_facts | Trusted facts example ]]
puppet.1533653730.txt.gz ยท Last modified: 2018/08/07 10:55 by k2patel