2 users 1 template
I have a module which defines a few users, each of whom have slightly different needs (e.g., home directory, uid, gid, groups, etc.). I'll use netatalk as an example, since we're using it for...
View Articleinstallation dealing with interactive questions - template - vfabric webserver
Trying to puppetize (open source edition) the vfabric webserver installation. The command for the install is ./newserver --server=tcweb --rootdir=/opt/vfabric-web-server...
View ArticleHow to declare a selectable hash class parameter?
Salut, I need a selectable hash parameter in my class definition: class colors ( $flavor = 'myfavorites', $nice_colors = $flavor ? { 'myfavorites' => { 'red' => false, 'green' => true, 'blue'...
View ArticleHow to render a specific template (file resource) for a specific client?
What's the puppet agent command to see how a file resource would be rendered for a specific machine (w/o actually applying it --noop but seeing the diff)? Does this resource have to be in the catalog...
View ArticleLookup destination path of a file in a template.
Is it possible to determine the destination path while a template's being rendered?file { 'my_cool_file': path => '/etc/somewhere', content => template('coolmodule/coolfile.erb'), } file {...
View ArticleHow to make erb templates strip out carriage return characters
I'm working on Windows (using VMs) and I added some `.sh` scripts to provision, but they are all written with carriage return characters, which apparently really confuse bash, so when I try to run them...
View ArticleHow 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 Articlerefreshonly on exec resource not working on file change
I have two config files and based on that I want to refresh a script(stop and start) whenever there is a change in either of the files. Also, the script should not get refreshed if there is no change...
View ArticleAccess hiera array element in erb template
So, I have check_command check_nrpe!check_ntp_drift!<%= env['ntpservers'][0] %> in a template .erb file. This gives the error Function Call, Failed to parse template...
View ArticleInstalling a package doesn't work. Template values don't get passed to the...
I created my own module and there's multiple issues that I can't fix. I know there's modules in the forge for this, but I can't get any of them to work and I simply need the agent to install. 1) The...
View ArticlePuppet Apache module : template for /etc/apache2/conf-available/security.conf
Hello, even after reading the full https://github.com/puppetlabs/puppetlabs-apache page and googeling around i did not find answer to my questions and therefore i hope some of you could help. On Ubuntu...
View ArticleWhere is the proper place to put templates using roles and profiles practices?
I'm trying to create a template for use by the motd class in my base profile. I'm not quite sure where I should put it though. I'm also having trouble referencing the path from with the class. Here is...
View ArticleSet File content via Hiera
Hi, I am looking for the syntax to set the content for a File resource from hiera. Specifically I want to set the template being used: # Puppet class test ( $file_content = undef, ){...
View ArticleCopy multiple template files to target location on the puppet agent
I have a requirement wherein there are multiple template files that needs to be copied to the same target path on the puppet agent machine, and the target path is determined by facts. Is there a way to...
View ArticleERB template fails after upgrade to Puppet 4
Hi, we're upgrading from Puppet 3 to Puppet 4 and hit some issues with custom facts no longer working. Custom fact name: logservers.rb, it returns a string of IPs: '1.2.3.4, 5,6,7,8'. We then turn the...
View Article