similar to: exported resources and templating

Displaying 20 results from an estimated 30000 matches similar to: "exported resources and templating"

2012 Jan 23
13
Template Help Please
Hello, I am trying to setup a template with data being passed in as a long string of data which is being returned via extlookup() i.e. $resolvers = "10.10.10.10 11.11.11.11.12.12.12.12" The template should split those up and put a nameserver entry per line in /etc/resolv.conf I have this in the template now:- <%=
2013 Mar 08
2
multiple pamameter values in puppet dashboard ENC
Is there a way to use send multiple parameter values using puppet dashboard ENC? For example, nameserver = 10.0.0.1, 10.0.0.2 or perhaps nameserver = [''10.0.0.1'',''10.0.0.2''} then the template erb file can loop through each of the nameserver values to set up mulitple nameservers in resolve.conf? Thanks - Oli -- You received this message because you are
2012 Sep 03
2
erb syntaxes
Hi guys, I''m trying to do the following in my template: location <%= location %> { proxy_pass <%= proxy %>; <% if scope.lookupvar(''nginx::resource::location::proxy_header'') then scope.lookupvar(''nginx::resource::location::proxy_header'').each do |header| %> proxy_set_header <%= header %> <% end
2009 May 31
9
No more than one "instances" of a type in define()?
Hi folks, when I try to do something like: define railsproject($name, $uid, $gid, $userpass, $sqlpass) { mysql_database { "$name_staging": ensure => present } mysql_database { "$name_production": ensure => present} ....more stuff... } I get: Puppet::Parser::AST::Resource failed with error ArgumentError: Duplicate definition: Mysql_database[] is already
2012 May 29
1
Simply Auto Increment A Number
Hi, I have a template which looks like this <% scope.lookupvar(''openldap::params::ldapservers'').each do |var| -%> olcSyncrepl: {0}rid=001 provider="ldap://<%= var %>:389" type=refreshAndPer sist retry="5 5 300 +" searchbase="<%= scope.lookupvar(''openldap::params::searchbase'') %>" attrs="*,+" bindmeth
2011 Oct 24
3
extlookup not working correctly in 2.7.6
I''m trying to upgrade from 2.6.7 to to 2.7.6 and I''m running into an issue in my extlookup() calls. A lot of the variables which should be defined aren''t defined within extlookup.rb. I''ve tested 2.6.7 agent and 2.7.5 agent against the 2.6.7 master and 2.7.6 master. I adjusted extlookup.rb slightly to provide some debug output.
2012 Aug 13
2
Variables and scope with inherits
I want to have a parametrized class with lookup from params.pp but I keep getting into problems. init.pp: class foo ( $bar = $foo::params::bar, $foofoo = $foo::params::foofoo ) inherits foo::params { file {''/tmp/foobar'': content => template("foo/foobar.erb"), } } params: class foo::params { $bar = true if $foo::bar { $foobar =
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>,
2013 Jul 30
2
Failed to parse template, wrong number of arguments (create_resources)
I''m having some issues trying to track down a problem I''m having parsing a simple template, using create_resources and Hiera. Here''s my setup (abridged): ../hieradata/settings.yaml: *global:* * variables:* * env: foo* * * *appSpecific:* * serverName: someServer* ../modules/test/manifests/init.pp: *class test {* * create_resources(test::variables,
2007 May 01
8
Custom functions and facts
Hello! I''ve been trying to use facts from Facter in a custom function. I''ve been following Matthew''s entry in the wiki (http://www.reductivelabs.com/trac/puppet/wiki/WritingYourOwnFunctions). What i''m seeing is that Facter[''fqdn''].value is always returning the fqdn of the puppetmaster host. I was expecting the fqdn of the client host.
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
2009 Nov 25
1
Puppet custom functions and user permissions
Puppet custom functions and user permissions I am busy writing a custom function to automatically add OSSEC agents to a OSSEC server after installation. Unfortunately, it seems that puppetmasterd is not respecting the entries in /etc/group in linux. No matter how many other groups the puppet user has been added to in /etc/ group, when puppetmasterd runs the custom function the effective/real user
2013 Sep 18
7
Puppet requires second run to execute some catalog items.
Hi, I''ve inherited a puppet setup for automating php installation and extension management. We''re on Debian and we''ve encountered a strange issue that I''ve traced down back to puppet I think. I''ve stripped back the configuration and made the problem reproducible, logs and config pasted below. 1. php5-common, php5-memcache, and php5-mysql are all
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 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 Nov 16
11
What is the offical variable scope best practice?
I read the guide at http://docs.puppetlabs.com/guides/scope_and_puppet.htmland others'' mail, i am a little confused now, below is my understanding: 1. top scope only refers to site.pp, not include node definitions and facts. 2. in puppet class, using variables not local, must specify the namespace, like $class::variable, if it''s a top scope variable or a fact variable or 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
2012 Apr 11
8
Facter not initialized in rspec in puppetlabs-stdlib?
I have been working on adding some predicate functions to puppetlabs-stdlib that test things based on ''interfaces'' and related facts. The functions themselves seem to work fine in my manifest-based smoketests, but I am running into trouble that may or may not be due to my ignorance about rspec or Facter. Something needs to be done to initialize Facter because
2010 Jun 24
7
Yet more variable scoping pain.
Some days I wonder why I even bother with puppet. --- classes: - datacentre::new_york - role::appserver - elements::tfel0 environment: production: parameters: < set key/value pairs here > class ldap { < do some stuff that behaves slightly differently between different data centers > } class role::appserver { include ldap } So, I wanted to set some variables in the
2011 Aug 11
6
need urgent help with including Ruby DSL class from puppet manifests
Hi, I have a Ruby class in "nagios" module - it''s located in nagios/ manifests/ssa_nagios_checks.rb and looks like this hostclass :ssa_nagios_checks do ... end In nagios/manifests/init.pp I have class nagios::server { ... include ssa_nagios_checks ... } And I get the following error .... debug: importing ''/etc/puppet/modules/nagios/manifests/