similar to: Hash Interpolation inside double quotes?

Displaying 20 results from an estimated 1000 matches similar to: "Hash Interpolation inside double quotes?"

2012 Aug 27
5
Append string to list items.
I have an array: $nodes = [''gfs01'' ,''gfs02'', ''gfs03'', ''gfs04] and a string variable: $brick_store = "/var/bricks" How can I append "/var/bricks" to each item in the array? Lack of a looping construct makes this challenging in puppet. Such that: brick_array = [''gfs01:/var/bricks'',
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
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
2011 Sep 30
2
Sugarsync not working now.
Hi all First post on the Wine forum and a newbie to Linux but I'm loving it. I was surprised how well Sugarsync ran in Wine until, when a window opened in Sugarsync and prompted me to update I accepted. Now it won't synchronise and has corrupted the cloud storage. I tried uninstalling then reinstalling but it was still the same. The version of Sugarsync I have upgraded to is 1.9.35 and
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 Jul 02
8
err: Could not retrieve catalog from remote server: Could not intern from pson: Could not convert from pson: Could not find relationship target "File[]"
I''m running Puppet 2.7.1 on the master as well as the agent and just received a new error which doesn''t actually reference a module or a file, so I''m somewhat stuck as to how to debug this. Any pointers? The error is err: Could not retrieve catalog from remote server: Could not intern from pson: Could not convert from pson: Could not find relationship target
2012 Jul 25
3
manifest variable with sed - problem
Hello, i have a problem in my sudo manifest file, because in the variable $name comes sometimes usernames like user.lastname, but i need for sudo (includedir */etc/sudoers.d/*) file names with no dots (like user_lastname). I need a new variable, where is the dots change by underscores. My first try was like this, but it isn''t working well. $name_underscore = "`echo $name | sed
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 Mar 27
1
Arrays from templates
Hi, I am having an issue trying to use the inline_template function to return an array. This is what I do: $array = inline_template ("<%= a=[''a1'',''b2'',''c3'']; a %>") notify {"array: ${array}":} And that works, showing the typical comma-less string: notice: /Stage[main]//Notify[array: a1b2c3]/message: defined
2010 Oct 14
8
manipulating facter variable
I''m trying to manipulate the following facter variable: ipaddress => 10.85.207.2 What I need is the second group of digits. If it''s 84 then location is A, but if it''s 85 then location is B. In puppet I couldn''t grab this second set of digits, but maybe there is a way? I''ve already tried to make a custom fact, but my ruby knowledge is *ahem* pretty
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 {
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
2011 May 23
2
Variable interpolation challenge
I''m having a problem with variable interpolation that I haven''t found a good solution to. I want to use a variable as part of the name of a fact, but the interpolation doesn''t work as expected. I''ve allowed for passing the mac address into my define() but if it''s not provided I want to look it up via facter. if
2011 Feb 02
11
How to include the Scope(...) in a generated string?
I''d like to include similar information that notice() spits out in a file I am generating -- basically so that anyone looking at the generated file (actually a file fragment) could trace it back to the class that is generating the entry. Using $name within the file fragment is the closest I am getting to what I want -- is there anything better? -- You received this message because you
2010 Dec 14
7
source /etc/profile
Hello , There is a way to source /etc/profile inside puppet on demand? My problem is that I install Java, afterwards I set JAVA_HOME variable in /etc/profile. After Java is installed, a gem which depends on Java starts to install ... but as it needs JAVA_HOME environment to be set, it fails. I am not sure what can I do ... Thank you, Adrian -- You received this message because you are
2012 Oct 29
2
array and string
hi all, I have an array and i would like to convert it into a string format. e.g. $server = ["node1", "node2", "node3"] when I write my puppet codes exec { "myscript -S $server": path => XXXX } my $server becomes a continual string like: "node1node2node3", instead of "node1 node2 node3". How can i have a delimiter of space in
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}",
2012 Dec 14
11
Puppet and Mcollective yaml file changing when it shouldn't
Has anyone else ran into this? debug: /Stage[main]/Mcollective/File[/var/tmp/facts.yaml]/content: Executing ''diff -u /var/tmp/facts.yaml /tmp/puppet-file20121214-13448-933j3r-0'' notice: /Stage[main]/Mcollective/File[/var/tmp/facts.yaml]/content: --- /var/tmp/facts.yaml 2012-12-14 00:53:20.000000000 +0000 +++ /tmp/puppet-file20121214-13448-933j3r-0 2012-12-14
2013 Nov 18
3
Is it possible to evaluate a string as a parameter name?
Hi, I''m looking to combine a couple of fact names with the value of a class parameter to create and lookup the resulting fact''s value. Is that possible? For example, my class will take the parameter "my_default_nic" from beyond. So I know that as long as $my_default_nic exists on the client, then so will facts like macaddress_<NIC>, netmask_<NIC>,
2010 Dec 26
6
variables created with generate() function have a newline when used in a template
I have this in nodes.pp $puppetmaster_fqdn = generate("/usr/bin/facter","fqdn") and this in a template http://<%= puppetmaster_fqdn %>:8080 When puppet runs, this is the result: http://puppet.home :8080 Anybody any clue to whats causing this? I''ve tried -%> -- You received this message because you are subscribed to the Google Groups "Puppet