similar to: multiple functions in one file?

Displaying 20 results from an estimated 1000 matches similar to: "multiple functions in one file?"

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.
2009 Jan 02
2
problem with custom funcion
Hello! I''ve written custom function split - it''s located in modules/common/ plugins/puppet/parser/functions/split.rb and contains: module Puppet::Parser::Functions newfunction(:split, :type => :rvalue) do |args| str=args[0] regex=args[1] idx=args[2] out=str.split(/#{regex}/) if out.is_a? Array out[idx] else "" end
2007 Jun 06
2
lookup in CSV recipe
I await Luke''s node settings implementation with interest. At the moment however, I have this sort of ugliness: $site = $hostname ? { fred => "opsera", barney => "bedrock", default => "unknown site", ... } So I''ve knocked up this little function to use CSV files instead. Now I can just do: $site =
2012 Feb 22
4
Custom function issue
Hi, I needed a function to check if a file is existing on the Debian box I am configuring. So I used this one module Puppet::Parser::Functions newfunction(:file_exists, :type => :rvalue) do |args| if File.exists?(args[0]) return 1 else return 0 end end end It work greats for some service where apache2 doesn''t work for me. I am using it this way
2007 May 26
13
munin module: manage clients and server''s config
Hello all. Probably this question has already been posed in the context of another software, but I am unable to find it. I would like to implement a module which should manage munin-clients as well as the munin-server. Here is what I am thinking about implementing: - There are two classes: munin::client and munin::server - munin::clients'' configuration will be managed automatically.
2013 Mar 07
1
HELP:Custom function didn't work
hi,guys- I have a mysql database which stores host informations,so I wrote a function to get some values. - Here is the function rb(this function should return the type I defined in the database): #hosttype.rb require "mysql" module Puppet::Parser::Functions newfunction(:hosttype, :type => :rvalue, :doc => "Gets host type from db.") do |args|
2009 Feb 02
2
public facts repository
Hello all, I have set up a public svn repository with some facts that we have written over time: https://svn.ikw.uni-osnabrueck.de/dav/ikwadmin/public/puppet/facts/ (yes, it is svn). Now, I was wondering where to document this on the puppet-wiki (or should it rather be the facter-wiki) http://reductivelabs.com/trac/puppet/tags/facter%2Crecipe does not give any clear hint on this. Maybe I
2008 May 02
4
Functions vs. Module Plugins vs. Facts
Hey all, I am trying to get a modified hostname (converting "blah-1234567" to "1234567") to use in my manifests and templates. I have it working for templates by using Ruby (*<%= hostname.split(''-'').pop.downcase %>*) but I haven''t been able to use it in manifests because they don''t process ERB. The way I see it I could do one of two
2013 Feb 03
3
Another "function does not return a value" problem
Here''s the function: module Puppet::Parser::Functions newfunction(:fact_to_array, :type => :rvalue) do |args| args[0].split('','') end end Here''s the class I''m trying to use it in: class oms::all_config { file { ''/var/lib/oms/config'': source => ''puppet:///deployment/deployment'', recurse =>
2013 Oct 21
3
how to pass the value to custom function?
Dear all, I''m trying this thing for a while but can''t figure out what am I doing wrong. Here is my sample function (which is similar to the original one, except for the hash, which is generated dynamically in the original one): module Puppet::Parser::Functions > newfunction(:am_running_oss, :type => :rvalue ) do |args| > > oss =
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
2007 Apr 26
5
$processor fact not working on OS X
Hello dear list. First of all thanks to all the developers for the great work on puppet. After using it for a while, there is not better tool to manage a network! I have a problem with the $processor fact, which seems to be either not there or ignored at all. I try to implement package deployment for the Macs (Intel vs. PowerPC) as described here:
2008 Jan 18
7
puppet 0.23.2 can''t collect exported resources
hi,guys I''m test the resources export and collect , OS is Debian etch and sarge, puppet server and client version all of the 0.23.2 ; the db is MySQL-4.1 My test code is like this. node ''b'' { @@file {"/tmp/a": ensure => present ,content => "test"; } } node ''a'' { File <<||>> } I run puppetd on
2007 Jul 11
3
Strange problem with exported ressources
Hi there, I have a strange problem with the exported ressources in the munin module I wrote. See: http://mail.madstop.com/pipermail/puppet-users/2007-June/003179.html For some reason it stopped working. On the munin::host I get the error that: err: Could not retrieve configuration: Exported resource File[munin_def_XY_4949] cannot override local resource The munin::host is also a
2007 Feb 07
9
Creating random shared passwords/keys
Hi there, I have a problem I don''t know how to solve. Let''s say you have two services, applications, whatever that communicate with each other, and they establish a shared password or key to authenticate to the other part. This happens with DHCP/DNS (I think is called dynamic zone update, the DHCP server updates the DNS zone with information from the dynamically configured
2011 May 19
2
custom function from .24.6 not working in 2.6 (from squeeze)
I''m in the process of upgrading an existing installation from .24.x to 2.6. We seem to have a custom function that is throwing the error: "err: Could not retrieve catalog from remote server: Error 400 on SERVER: private method `gsub'' called for #<Array:0x7fdcebf3bbf8> at /etc/puppet/manifests/classes/apache-php.pp:72" Here is the function: """ #
2007 Sep 11
25
Re: #786: exported resources not refreshed
Hello all, what exactly is the "design decision" that is needed here? We currently have the problem that 0.23.2-3 (debian package) does not work when it comes to collecting exported resources. The resources are saved in the database, so picking them up is the problem (db is Mysql5.x). This is a major problem for us, since we are using this a lot for our monitoring services. I
2007 Apr 30
10
mount type and ensure => present on OS X
Hello all. There is some strange thing going on with our OS X clients. We have created a package which is run via SystemStarter. What it does? It parses /etc/fstab and mounts the NFS directories mentioned there. This is needed since we want to have static mounts and the NetInfo-automounter combination does not do static mounts (even with ttl=0 set for the mount, which is supposed to do a
2011 Jun 14
4
Question about custom function.
Hello group, I''m trying to generate configuration for tomcat server. I want it to depend on my mod_jk properties file. I wrote some simple script which you can see here: http://pastebin.com/CffBr0Nc it works just fine. So I tried to move it to puppet as my custom function. It''s available for review here: http://pastebin.com/AeQgTTT6 Now, when I''m running first in irb,
2007 Aug 28
3
virtual resources in 0.23.2, do they work?
Hello all. I am using the munin module for a while now, I think that after the upgrade to puppet and puppetmaster 0.23.2 (or 0.23.1) it simply stopped working. Were there any changes to the realizing and exporting of resources? What could prevent this module from stopping to work. What happenes is that new hosts (munin::client nodes) do get stored in the database, but the munin::host does not