Displaying 20 results from an estimated 5000 matches similar to: "File selection for template() similar to source"
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
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
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
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
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 Jun 11
2
hiera data bindings and template()
Hi,
I''m using Puppet 3.2.1 and heavily relying on hiera data bindings.
I have the following situation:
class software (
$my_content = undef,
) {
file { ''/path/to/file'':
content => $software::my_content,
}
}
in hieradata/software.yaml (hiera.yaml seems ok):
software::my_content: template(''mymodule/myfile.erb'')
With this configuration I
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
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
2012 Jun 07
4
Dealing with multiple gid changes
So I discovered yesterday that if puppet changes the gid of a group it
doesn''t go through the file system and update them with the new correct gid
(at least this was the case on RHEL5 and client puppet v2.6.16 and
puppetmaster 2.7.12). Now I thought that it might be possible to have
puppet execute something like find /home/ -group <old_gid> | xargs chgrp
groupname. However
2012 May 18
24
Announce: PuppetDB 0.9.0 (first release) is available
PuppetDB, a component of the Puppet Data Library, is a centralized storage
daemon for auto-generated data. This initial release of PuppetDB targets the
storage of catalogs and facts:
* It’s a drop-in, 100% compatible replacement for storeconfigs
* It’s a drop-in, 100% compatible replacement for inventory service
* It hooks into your Puppet infrastructure using Puppet’s pre-existing
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
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
2010 Jul 07
5
problems with sieve under 2.0...
I'm experimenting with a 2.0 setup, using the sieve plugin for 2.0 from
mercurial.
Without sieve, everything seems to work fine. Once I put in a
.dovecot.sieve file, though, nothing gets delivered, with the only hint
of what's going wrong being this mess in syslog:
Jul 7 13:18:00 bellman dovecot: lda(perry): Panic: file index-transaction.c: line 70 (index_transaction_init): assertion
2011 Feb 07
18
[PATCH] Btrfs-progs use safe string manipulation functions
Please find the attached patch which replace unsafe strcpy(3) by
strncpy(3) functions.
regards,
Eduardo Silva
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
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
2012 Sep 28
2
nested modules and autoloading
All-
I''m using puppet 2.7.14. I''ve reviewed
http://docs.puppetlabs.com/puppet/2.7/reference/modules_fundamentals.html
but it doesn''t seem to cover what I''m attempting.
Consider a module layout like this:
$ tree mymodule
mymodule
|-- Modulefile
|-- README
|-- manifests
| |-- init.pp
| |-- special_type
| | `-- prereqs.pp
| `-- special_type.pp
2012 Feb 03
16
neatest way to determine a major version of centos/linux?
Just started a rollout of centos 6.x across our Puppet deployment
(100-odd servers).
what fact would people suggest I use to distinguish 5.x from 6.x
(quite a lot of subsystems are different between major releases)?
lsb* facts don''t seem to be present on centos 6 - is this an EPEL bug,
or have they
just been removed in Facter?
Thanks!
--
You received this message because you are
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
2013 Jul 12
1
ERB template pain
Hi,
I have stupid situation that I may workaround but I think there is an
elegant way to deal with.
Still I need the community help.
In some class X I have:
$control = {
dev => {
id => 7,
name => ''GG''
},
prod => {
id => 1,
name => ''Info''
}
}
In some other class, which I apply to a node I have defined file from a