Displaying 20 results from an estimated 39 matches for "newfunctions".
Did you mean:
newfunction
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
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
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
2008 Oct 03
7
form_remote_tag and :with
I am trying to pass the result from a javascript function along with
the result from a text_field with form_remote_tag. This is what I
have so far, but no go:
<% form_remote_tag(:url => {:controller => ''requests'', :action =>
''create''}, :with => "''data=''+request()", :update => ''request_sent'' )
2009 Jul 28
1
Wishlist: Navigate to "Index" page of help when no topic specified (PR#13860)
Hi all,
When I install a new package, and don't yet know any function names,
I have to play the "poor man's game" to get to the standard
help system "Index" page for the package:
Poor Man's Game -=20
Load new package;=20
issue search() command;
find position (say N) of loaded package;=20
issue objects(pos =3D N) command;
get name of a random function (san
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,
2013 Aug 20
1
[LLVMdev] Question about removeFromParent
I have Function
Function* F;
and one of its basic blocks BB
I want to insert this BB into a new function without remove it from the
original
according that BList is the list of the basic blocks of the newFunction
BList.insert(BB);
but I don't want to call BB->removeFromParent(); and without this method it
give me error that BB is already in a container
is there another function that get
2009 Aug 05
2
Wishlist: Navigate to "Index" page of help when no topic (PR#13872)
On 04/08/2009 7:33 PM, Steven McKinney wrote:
>> -----Original Message-----
>> From: Duncan Murdoch [mailto:murdoch at stats.uwo.ca]
>> Sent: Tuesday, August 04, 2009 8:03 AM
>> To: Steven McKinney
>> Cc: r-devel at stat.math.ethz.ch; R-bugs at r-project.org
>> Subject: Re: [Rd] Wishlist: Navigate to "Index" page of help when no
>> topic
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 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":
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 =>
2009 Aug 04
0
Wishlist: Navigate to "Index" page of help when no topic (PR#13868)
On 7/28/2009 6:30 PM, smckinney at bccrc.ca wrote:
> Hi all,
>
> When I install a new package, and don't yet know any function names,
> I have to play the "poor man's game" to get to the standard
> help system "Index" page for the package:
You could complain to the package author or maintainer, who should have
created a help alias with the package name
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
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
2009 Aug 04
0
Wishlist: Navigate to "Index" page of help when no topic (PR#13871)
> -----Original Message-----
> From: Duncan Murdoch [mailto:murdoch at stats.uwo.ca]
> Sent: Tuesday, August 04, 2009 8:03 AM
> To: Steven McKinney
> Cc: r-devel at stat.math.ethz.ch; R-bugs at r-project.org
> Subject: Re: [Rd] Wishlist: Navigate to "Index" page of help when no
> topic specified (PR#13860)
>=20
> On 7/28/2009 6:30 PM, smckinney at bccrc.ca
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:
"""
#