similar to: How to include the Scope(...) in a generated string?

Displaying 20 results from an estimated 20000 matches similar to: "How to include the Scope(...) in a generated string?"

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
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 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,
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 {
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 Oct 14
7
ANNOUNCE: Puppet 2.6.3 - Release Candidate 1 available!
All too quickly we''re back with a maintenance release: 2.6.3. This release addresses some issues in the 2.6.2 release. 2.6.3 is a maintenance release in the 2.6.x branch and it contains only bug fixes and no new features or other changes. The release candidate is available for download at: http://puppetlabs.com/downloads/puppet/puppet-2.6.3rc1.tar.gz Please note that all final
2011 Aug 08
12
Hash Interpolation inside double quotes?
I''ve got this: file { ''/opt/sugarsync/tomcat/tomcat-home/current'': ensure => "tomcat-$config[''tomcat_version_server'']"; where $config[''tomcat_version_server''] was set with extlookup (the yaml one), by loading: --- tomcat_config: tomcat_version_server: 6.0.20-1 tomcat_version_libs: 1.0-1
2011 Jan 31
3
Anyone using config_version successfully?
I have tried to use config_version and failed due to limitations in the way I would like to use it: - http://projects.puppetlabs.com/issues/3692 - http://projects.puppetlabs.com/issues/4845 - http://projects.puppetlabs.com/issues/5404 As part of http://projects.puppetlabs.com/issues/3692, we''d like to get a handle on who in the puppet community is using config_version successfully as it
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
2013 Feb 21
8
Facter & Puppet disagree on RHEL 6?
I''ve run into an odd one on one of my new RHEL 6 boxes. Puppet and Facter seem to disagree about the value of a fact. Puppet version: 2.7.9 Facter version: 1.6.4 Module: puppetlabs-apache apache::params falls through its if structure: if $::osfamily == ''redhat'' or $::operatingsystem == ''amazon'' { ... } elsif $::osfamily ==
2012 Feb 08
10
puppetd hanging on some nodes
Hi All, In my set-up, I''ve got a cron job that triggers a Puppet run every 20 minutes. I''ve found that on approximately 13 nodes (out of 166), puppetd just hangs. I have to go in, kill the process, remove /var/lib/puppet/state/puppetdlock, and run puppet again and then it''s fine. After a while, it just hangs again so I have to go in, kill the process, etc. Any ideas?
2012 Jun 18
8
Conditional with variable from facter
Hi. I have the following facts available: # facter | grep oper operatingsystem => CentOS operatingsystemrelease => 6.2 Now, if I wish to use conditionals on these facts, I have to do it like this: case $operatingsystem {} case $::operatingsystemrelease {} I''m puzzled as to why can''t I just use $operatingsystemrelease, and what do these two semicolons mean? Thank
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 Oct 06
3
Checking and setting svc properties in Solaris
Hello folks, I''ve been looking into how I might check (and possibly set) svc properties via puppet. The closest I''ve found, is the provider/service/smf stuff. However, that seems to only allow enabling and disabling of services. NOT of configuring properties. Is there some way I dont know of, how to do that? If not, and I need to write something... under which module/plugin/
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
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}",
2013 Mar 05
12
Boolean in hiera... problems again
Hi... I''ve been trying to set up boolean values in Hiera, but with no luck. For example, I''m using puppetlabs-haproxy module, and this is a code snippet: class haproxy ( $manage_service = true, ... ) inherits haproxy::params { ... if $manage_service { } } Now, this is how I set up values in hiera: haproxy::manage_service: false But, it seems that
2012 Mar 08
2
How do I quote a percent sign in the text of a template?
Hi I am scratching my head on this not being a ruby person... I am turning my kickstart files into templates, but am having issues with percent signs in free form text. This returns a syntax error: %post OK, fine , let me escape it: %%post No error, but the end result is %%post Not quite what I wanted I''m missing something blindingly obvious - can someone point me to it? :-)
2011 Aug 09
8
ANNOUNCE: Puppet Module Tool version 0.3.4
Hi all We''ve just released version 0.3.4 of the puppet-module tool used to create and retrieve modules from the Puppet Labs Forge (http://forge.puppetlabs.com). You can update using Ruby gems: $ gem install puppet-module There are several important changes in this release: * Add ability to install modules with hyphens * Add check for symlink when installing * Install modules to their
2010 Jun 30
1
Problem using the logadm pattern
Hi All I am trying to deploy the Solaris logadm pattern from http://projects.reductivelabs.com/projects/puppet/wiki/Logadm_Patterns. I dropped it in .../lib/puppet/type/logadm.rb However, I am getting an error message: err: Could not run Puppet configuration client: Munging failed for value "puppet" in class backup: Global resource access is deprecated And I have traced it back to