How to generate/test a template file for rspec tests?
I've created a file resource that is using a template file as content which is generated from a automatic hiera lookup. $source_list_template = template($sources['list.template']) file {...
View Articlequestion on hash and referencing in template
hi, question on hash and template. if i have a hash as such: $job_hash = { 'foo' => { ensure => 'present', enabled => 1, config => template('jenkins/build-mvn-master.xml.erb') }, 'foo2'...
View ArticleHow do I use deeper facts in a template .erb?
I'm using Facter 3. For example in a message of the day module i'm using this syntax in my .erb template: - This system is running: <%= @operatingsystem %> (displays "CentOS") - Filesystem Type:...
View ArticleFailed to apply catalog: Parameter source failed on Firewall
Hi there! How i can set source interface address in firewall rule? I try it: firewall { '000 her': chain => 'PREROUTING', table => 'raw', source => '! <%= ipaddress_eth0 %>', jump =>...
View ArticleCan't successfully build module
I've tried every tutorial I can find. I can't get puppet to successfully build a very basic module that calls a class and deploys a file from template. I'm running RHEL 7 with Puppet 3.6.2 from the...
View ArticlePuppet Duplicate declaration error using file template and concat
While extending a puppet module which should manage `/etc/network/interfaces` I am facing the following problem: The old module just reads some vars from hiera and creates the file with one interface...
View ArticleValue from hiera nested hash in erb template
Hi there, I have the following: --- foo: bar01: someval: foovalue bar02: someval: barvalue Now, I want to request the value of "foo::bar01::someval" and put it in a puppet erb template. eg. The first...
View ArticleQuery on template multiple conditions
Hi, Is it possible for templates to have multiple if and/or statements. It seems to work ok for 2, however any more than this and it does not seem to work correctly. Details: Works for <% if...
View Articlepuppet variables not coming through in template?
Here is a simple test case that shows what I am trying to do. I have a hash passed in through hiera and I want to apply a different template to generate a different file for each key. However the...
View ArticleManaging a single template from multiple modules
Hi there, I have some situations where I need to manage a single file and possibly even single value in that file. ie. limits.conf. You have the one config: /etc/security/limits.conf And even one...
View ArticleIgnore literal special characters in template
I'm working on templatizing a postgres conf file that has a literal line like this log_line_prefix = '<%u %%%d %%%t %r>' that gets interpreted as ERB code because of the `<%`. A syntax check...
View ArticleHow to escape special characters in template
I've got a file that needs the following content verbatim (the $ should be in the file, not interpreted). $pbsserver foo.localdomain I've made a template like so \$pbsserver <%= @fqdn %> Yet,...
View ArticleERP Template / List of all Cronjobs defined by Puppet
Hi, i would make a TXT/ ERP - Template file on every Puppet-Agent, where i documented the createt Cronjobs. I need the ensure; timeintervall; command in this template. This file should be exportet and...
View ArticleCross Module Config
Hi, I created a module for snmp with a template. Now, I have a second module for Hardware RAID Servers. It installs the RAID Controller Utility and it SHOULD also set up monitoring. For that, I need...
View ArticleHow do I access merged hiera data directly from a template?
I have hiera data that is being merged in via 3 different levels: :hierarchy: - name/hostname - class/hostclass - global and when I use a hiera_hash to extract the merged data in my module, it works...
View Articlecomposition nodes of the parts of the module
hi there I want to describe the module in the node "solve" any part of this module will "work": class myclass { service {...} file {... content => template (blabla.erb), ...} package {...} }...
View Articlesyntax error unexpected kend expecting $end
Hi, I am getting this error with the below syntax, any idea what I need to do to get this working? The ruby I believe seems ok. Details: <% if definition == "someserver" -%> $ModLoad...
View ArticleArray data use within a template
I have taken the NRPE plugin (for Nagios) from the puppet forge and tweaked it in order to get it to work for NCPA as well as NRPE. Without getting too much into it, they went from an include directory...
View ArticleAccessing resource collector from template
I'm using puppet to deploy haproxy configurations and SSL keys/certificates. I'm trying to use puppet's knowledge about the deployed keyfiles to automatically generate parts of the haproxy...
View Articlewant to be able to put the raw erb file on the client host as well as...
We don't want to give our developers access to our puppet manifests/erb templates as of yet, but we want to be able to put the erb code onto the development box as well as how the erb is interpreted....
View Article