Displaying 20 results from an estimated 600 matches similar to: "manifest variable with sed - problem"
2012 Feb 29
3
Modifying a FACT Value In a Manifest
In my network every subnets default gateway is X.X.X.1. That router
gateway is always running ntpd which I want to give be default as the ntp
server in every hosts ntp.conf.
Since there is no official "default gateway" fact yet, what I want to be
able to do in my manifest is take the $ipaddress fact and turn it into the
gateway for that subnet.
For example...
IP = 10.1.1.12
GW =
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
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
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'',
2009 Oct 29
2
template issue: nested variables?
I need to do something like this
node foo {
$iface = pcn0
...
}
# the template
<%= network_<%= iface %> %>/<% netmask_<%= iface %> %>
The idea being that a file would be built on the client holding the
value of pcn0''s network/netmask
Of course, I''m trying to avoid hard coding the interface name in order
to keep my code portable.
Thanks in advance
2010 Dec 22
1
Puppet + Mongrel on RHEL5
I am trying to setup Puppet + Mongrel on RHEL5. So far I have followed
this document:
http://projects.puppetlabs.com/projects/puppet/wiki/Using_Mongrel_On_Enterprise_Linux
The puppetmasters all start up and Apache starts up on 8140.
However, when my client connects I get the following errors:
[root@lv1764p puppet]# puppetd --server puppetdev.encana.com --no-
daemonize -o -v
info: Retrieving
2013 Jun 10
5
Does stdlib break the regsubst function?
Hi all,
We are currently using the regsubst function of Puppet to generate some
information out of our hostnames (customer, environment, and so.). The
manifest is running fine since months.
7: $customer = regsubst($::fqdn, ''(^[^-]*)-[^-]*.*'', "\\1")
8: $environment = regsubst($::fqdn, ''^[^-]*-([^-]*).*'', "\\1")
9: $product =
2010 Apr 23
1
regsubst questions
I am attempting to set some variables in my manifest and I amd seeing
a result I don''t quite understand. Here is a section of code from my
manifest:
$boot_time = generate(''/usr/bin/env'', ''/bin/date'', ''+%H:%m'')
notice("boot_time => $boot_time")
$boot_hour =
2011 Aug 08
5
Run command based on OS version
I''m trying to write a script that runs command based on version of
Redhat OS. For example, if the RHEL version is 6.0, it will run
command. I was able to write file read script in ruby that would read
file and execute but it didn''t seem to work in puppet script. Has
anyone done something like this?
$redhat_version_file = "/etc/redhat-release"
$redhat_version =
2012 Feb 16
2
Basic string manipulation in puppet
Hi all,
Been searching the net for a few hours now.
I have a basic operation I wish to perform but, cannot find examples
close enough to what I''m after to implement it myself.
This is what I want to do:
$version = ''10.2.0''
I want to manipulate the string to make a new var ($cutversion), equal
just 102.
For example in perl (since I know it):
$version =
2012 Oct 02
4
Removing intermediate variables in calculation
Hello,
I have a small Puppet 2.7 module to configure Sonatype Nexus Professional.
The module takes, among other things, a baseurl in the form of
"http://example.com/path" and I''d like it to extract the "/path" from that
variable into a separate variable IF an optional "path" variable haven''t
been supplied.
Here is an extract:
class
2011 Jun 30
4
using memorysize fact in manifests
Hi,
I want some config depending on memorysize.
What I tried was
if ($memorysize >= 256 * 1024*1024) {
...
}
But this fails because $memorysize is a string (and contains a "G") and can''t be
compared to an int.
Are all facts strings? How do I work with numbers?
regards, Andreas
--
Andreas Kuntzagk
SystemAdministrator
MDC Berlin / BIMSB
Tel.: +49 30 9406 2997
--
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 27
9
CIDR-matching in puppet manifests?
I have a few settings that change based on the network that a system is
in, and I have a heterogeneous collection of networks (a few /24s, some
/25s, a /29 and a couple /27s, and hey look a /16 in rfc1918 space
and...). So I can''t do simple regex matches on dotted-quad IP notation
and expect to get a complete story.
What I''d like is something like, I dunno...
$nameserver =
2012 Oct 26
2
Using regex to match hostnames in hiera
Hi, I''m having a problem with extlookup not respecting the ''certname'' parameter[1]. When executing a puppet run with either the --certname or --fqdn parameters, it ends up using the specified SSL certificate and gets the correct node definition applied from the puppetmaster. However, it still retrieves extlookup data using the node''s actual FQDN, not the one
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
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
2011 Feb 17
1
Nested defined resources
I''m working on a module to handle creating and populating Python
virtualenvs. Without going into too much detail, basically these are
nicely-encapsulated environments into which python packages can be
installed and run. It''s not uncommon to have several virtualenvs on a
system, potentially with the same packages installed (maybe different
versions).
Puppet''s defines
2012 Jun 25
3
Base directory with File
Hi all,
I''d like to specify a base_directory and a list of directories (as
variables that may be pulled via hiera later) that will be created under
that base directory.
base_dir = "/home/base"
bars = ["a", "b", "c"]
bars will be used to create the folders under base and also part of the
information going into building a template so I