similar to: Arrays from templates

Displaying 20 results from an estimated 12000 matches similar to: "Arrays from templates"

2012 Mar 06
3
Inherited node tagging
Dear all, I have observed a behavior that doesn''t seem (to me) to match the documentation. Specially, about tagging, the doc says: " Automatic Tagging All language statements enclosed in a node, define or class structure (read more about puppet control structures [[Language Tutorial]] ) will automatically be tagged with the name of that statement. These automatically- applied
2013 Oct 07
17
Sync data between various PuppetDB instances
Dear all, We have a few reasons to have various PuppetDBs (and Masters, one per cluster) in our datacenter and, eventually, there may be a need to share *only* a few exported resources between clusters, like a few ssh-keys or nagios tests. Is there a mechanism to pull and push some exported resources from one PuppetDB to another? I guess this could be done with the API, but has anybody tried it,
2012 Mar 16
3
Simple hiera-puppet usage
Hi all, I am trying to understand how does hiera puppet backend work, so I created the following example: hiera.yaml has only: --- :backends: - puppet --- And the node: node ''testnode'' { $variable = ''kk'' $thing = hiera ("variable") notify { "note: $thing": } } I don''t want to use the yaml backend for now, just want to
2012 Mar 23
11
Plugins and Hiera
Dear all, This is a continuation of another thread, but I think the question diverged enough to create a new one. I have a hiera hierarchy like this: :hierarchy: - %{fqdn} - %{secundary_group} - %{primary_group} - %{productname} - all And I need to define the secondary/primary groups as facts, on the nodes. Gary has suggested me to use plugins, that they will provide the facts before
2009 Jun 30
6
Variable named "memory" in templates
I tried to use a Puppet variable named "$memory" and access it from a template, like this: $memory = 4711 file { "/tmp/test.txt": content => inline_template("memory = <%= memory %>\n"); } One would think that my file would contain "memory = 4711" after that, but instead the memory variable seems to hold a
2012 Jul 05
1
hash to_yaml in erb template not giving valid yaml
Hi, I want to use a file resource to write a facts.yaml file for Mcollective. For some reason it won''t provide a valid yaml format if I dump my scope to hash and convert to_yaml. file { "/etc/mcollective/facts.yaml" : owner => root, group => root, mode => 400, loglevel => debug, #content => inline_template("<%= scope.to_hash.reject {
2013 Oct 28
1
inline_template private method `gets' called for false:FalseClass
Hi, I am new to Ruby ERB and inline_template. Can anyone spot what''s wrong with this inline_template? $moddedContent = inline_template("<%= puts gets(nil).gsub(/one two three/,\"\") /tmp/blah %>") exec { "/bin/echo ''${moddedContent}'' > /tmp/blah" : } When I try to apply it, I
2011 Nov 04
2
problem with templates
I am having an issue with templates that I cant quite figure out why it is having an issue. I am using ruby dsl to read a template from a database and it keeps having problems with anything other than <%= var %> type definitions. I even went as far cutting and pasting from the puppet online documentation just to see if it were maybe something I goofed. I pasted below the tested template
2007 Feb 06
2
Mysterious tables starting with "stats_"
I have a server which I haven't installed that I have to maintain. This server uses MySQL, it has an asterisk database and in there some mysterious tables: stats_action, stats_agent, stats_callid, stats_config, stats_estados, stats_qstats, stats_queue, stats_queuexagent. I say mysterious because I don't have a clue about who is generating them. I did a grep for their names in /var,
2011 Jun 16
7
Problem with usage of arrays
Hi there, i can''t use array in puppet. Here is my codesnipplet: $callapidata = [ ''wert1'',''wert2''] notice $callapidata[1] A puppetrun results in: Could not retrieve catalog from remote server: Error 400 on SERVER: can''t convert String into Integer at /etc/puppet/myenv/modules/ uc4client/manifests/init.pp:41 on node testnode Thanks for your
2012 Aug 22
6
Duplicate definition : Merging arrays
Hello, I am trying to create a new array by combining two other arrays. I get the following error while running : Duplicate definition: Print[test0] is already defined in file /etc/puppet/manifests/test.pp at line 47; cannot redefine at /etc/puppet/manifests/test.pp:47 My code is similar to this : <snip> ..... ..... $sys_server = [ ginger , test0 ] $usr_server = [ test0, test1,
2009 Jul 30
7
arrays, loops, etc
Inspired by the recent thread titled "Array input of dirs, ensuring their existence" I thought I''d write up the problem I''m running into. I was chatting on irc about it, I don''t think puppet has a clean solution. Like the other poster, I''m defining an object that takes an array. In my case, I''m defining gpg keystore, which can contain a
2012 Aug 28
1
Array References?
The first notice command shows the array as having two elements. The second notice command shows the same array as having only one element. Some sort of variable reference thing? How can I make a copy of the $nodes array rather than make a reference to it? notice ("NODES1=$nodes") $n2 = $nodes $useless = inline_template("<%= n2.shift -%>") notice
2005 Oct 13
1
Worrisome race condition involving half-transferred files
Rsync people, Tell me if I'm wrong, but rsync seems to have a very serious race condition that would make it risky to transfer files into a directory writable by someone you don't trust if permissions are going to be granted to other people on those files. The rsync receiver creates a half-transferred file with 600 or 700 permissions; then the receiver writes the data and finalizes the
2011 Jul 21
0
Templates and self-knowledge
So, I''m into templating. I *like* templating. What I *don''t* like, of course, is to have to use multiple, similar templates for different output files. So, let''s work a concrete example. Suppose I have a template "standard_profile.erb" which looks like this: install_type initial_install > > system_type standalone > > partitioning
2013 Dec 02
1
Class parameter flexibility with ENC, hiera or both
Dear puppetteers, I am having a philosophical question about parametrized classes. When building modules, one wants to be as flexible as possible, to try to target as many puppet flavors as possible. This is our target: - Foreman users, using foreman as an ENC with smart variables (or potentially any other ENC, but I would say this is the most widespread one). - Pure Puppet''s site.pp
2013 Feb 20
1
Access puppet hash name in templates
Hi, I''ve defined a hash like so in my nodes.pp: net::addr { "eth5": rt => { rt1 => { address => ''192.168.10.0'', netmask => ''255.255.255.0'', gateway => ''192.5.28.19'', src =>
2011 Mar 31
5
Exclude a resource from reports
A little while back I asked how to make puppet not report on a resource.. and was shown the loglevel metaparam: Quoting bellman@nsc.liu.se: There is a metaparameter called ''loglevel''. If you set that to something lower than "notice" (i.e. either "info" or "debug"), then Puppet won''t report that it applied the resource... So I made my
2012 Dec 03
4
Unnecessary changes when creating facts.yaml
I have set up puppet to create a facts.yaml file for mcollective using the following line: content => inline_template("<%= scope.to_hash.reject { |k,v| k.to_s =~ /(uptime.*|timestamp|.*free|macaddress.*|ipaddress)/ }.to_yaml %>"), However, it is creating a lot of unnecessary changes by reordering the facts in the yaml output as you can see in the diff output between to
2010 Aug 31
3
File selection for template() similar to source
I want to be able to have Puppet determine which file to use as the source of a template() call in a manner similar to the source parameter. Basically, I want to have a file resource that will use the most appropriate file for a template. While I can do: file { "file.conf" : source => [ "puppet:///module/file.conf.${hostname}",