similar to: Functions vs. Module Plugins vs. Facts

Displaying 20 results from an estimated 10000 matches similar to: "Functions vs. Module Plugins vs. Facts"

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 =
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
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
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
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 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":
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
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 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 => [
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|
2012 Sep 30
6
err: Signing certificate error
Hi all, When i try to boot an ec2 instance using: *puppet node_aws bootstrap --server myserverOnAWS.com --image ami-61ad0108 --keyname test-malcom --login ubuntu --type m1.small --keyfile test-malcom.pem -g puppets --verbose --debug --puppetagent-certname test* I get this error: *notice: Signing certificate ...* *debug: certificate_status supports formats: b64_zlib_yaml pson raw yaml; using
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 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 =>
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
2012 Apr 05
3
newly added ruby function executes on the server instead of the node
Hi, 1) I added this test function tom my /etc/puppet/modules/write_line_to_file/lib/puppet/parser/functions/write_line_to_file.rb : *module Puppet::Parser::Functions newfunction(:write_line_to_file) do |args| filename = args[0] str = args[1] File.open(args[0], ''a'') {|fd| fd.puts str } end end* 2) I invoked it in the
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 =
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: """ #
2012 Dec 24
3
Not able to install puppet enterprise onn agent node using install command.
Hi, I have created an agent node from a master node using below command. puppet node_aws create --image ami-cc5af9a5 --keyname icos-client --type ti.micro Now as i am trying to install puppet on it using below command puppet node install \ --install-script=puppet- enterprise \ --installer-payload=/usr/local/puppet/puppet-2.7.0.tar.gz \ --installer-answers=/usr/local/puppet/agent.txt \
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