similar to: Custom function issue

Displaying 20 results from an estimated 11000 matches similar to: "Custom function issue"

2010 Nov 08
11
Default ownership for static files
Hi, I try to serve a file file { "/root/test3.txt": ensure => file, source => "puppet:///yum/test.txt", } On the puppetmaster this files look like this #$ ls -n test.txt -rw-r--r-- 1 502 301 4 8 Nov 16:25 test.txt Finally, here is my question: What ownership may I expect on the resulting file ? Actually this is the result for me: #$ ls -l
2008 Aug 14
1
multiple functions in one file?
Hi there, just to be sure: http://reductivelabs.com/trac/puppet/wiki/WritingYourOwnFunctions says that "The file name is derived from the name of the function that Puppet is trying to run." Is this still true? I ask because I currently write a set of math functions (min,max, plus, minus and so). My first try was to create a math.rb, where I had: module Puppet::Parser::Functions
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,
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
2009 Feb 01
2
Using arrays to generate parameters
My external node classifier returns some arrays in the list of parameters. Example output (names have been changed to protect the innocent): $ ./node_classifier a.b.com --- %YAML:1.0 "classes": ["class1", "class2", "class3"] "parameters": "hostname": "a" "name": "a" "domain":
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 =
2011 Oct 17
2
puppet dashboard and complex data
So I am messing around with puppet dashboard and for the most part for what I am working on it fits the bill for an ENC. The only question I have is I need to pass information about a customer to set up resources and the system can have multiple customers on it. What is the best way to handle complex data? Would I be able to pass json data for example? -- You received this message because you
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
2011 Apr 07
3
sourceselect & multiple sources not working
Hi, I am trying to configure a file resource with multiple sources, and browsing list archives and forums seems to indicate that sourceselect parameter with an array for the source param. But the final file gets created using the first matching parameter in the array. file { ''/etc/sysconfig/myconfig'': sourceselect => all, source => [
2010 Jun 24
8
Passenger barfs.
I have a freshly installed and updated CentOS 5.4 system running puppet 0.25.5. I followed the passenger docs here: http://projects.puppetlabs.com/projects/puppet/wiki/Using_Passenger Upon starting the client, the following appears in the apache error log. [Thu Jun 24 10:48:40 2010] [error] [client 10.10.4.45] Premature end of script headers: production [ pid=6785 file=ext/apache2/Hooks.cpp:706
2013 Oct 13
24
exporting custom facts to puppet agents
Dear all, I have a custom fact, that reads a file and then generate the values dynamically based on the file content. It''s something like this: inFile = "/home/admin/OSs.txt" > gos = {} > > if File.exist?(inFile) > open(inFile, ''r'').each do |line| > next if line =~ /^\s*(#|$)/ > parts =
2007 Nov 13
15
require metaparameter and gems
I tried to install the ''mongrel'' gem tonight via puppet in an attempt to migrate from webrick to mongrel as described on the puppet site[1]. I added the following to my manifest: package { "rubygems": ensure => installed; "mongrel": ensure => installed, provider => gem, require => Package["rubygems"]; }
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|
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
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: """ #
2010 Sep 07
2
Environmental Variables
Hi Everybody, I been looking through google for better part of the day but I haven''t been able to find an answer to my problem. I need an environmental variable to be present in puppet, so that yum works correctly. However after reboot puppet doesn''t read /etc/profile and starts without this profile. If I go into server and do services puppet restart than everything works fine,
2012 Dec 27
3
generate() function help
Hi. I want to run script which is distributed with my module, but the problem is I have to then hardcode the path to the script in the generate function call, for example: generate("/etc/puppet/environments/${environment}/modules/mymodule/scripts/myscript") But what If some other site uses other path to their modules, or doesn''t use environments at all? Is it possible
2007 Jun 11
5
string conversion?
Hi there! Is it possible to do something string converison like in puppet? My problem: I have a variable that contains a path ($variable = "some/value"). This variable is passed on as an option to an external script, which uses the variables content to generate I) a path and II) a filename, converting the "/" to "_" for that filename. I donĀ“t really see a way to