search for: writingyourownfunct

Displaying 15 results from an estimated 15 matches for "writingyourownfunct".

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. Here''s the code that is exhibiting this behavior: require ''md5'' module Puppet::Parser::Func...
2008 Dec 08
5
if file exists
Is there a condition test to see if a file exists on the puppetmaster? I have about 15 different license files that are loaded on thirteen servers. Not every license goes on every server. I''d like to serve the files only if they exist on the puppet master server. I''m thinking of doing it like this: define install_license($host) {
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::F...
2007 Feb 07
2
Writing your own functions
In case anyone is interested in extending the Puppetmaster by writing new functions, I''ve written up some notes on how to do it, gleaned from my own experience earlier today: http://reductivelabs.com/trac/puppet/wiki/WritingYourOwnFunctions Corrections from people who''ve done it before, or who are wanting to do it, as to correctness, clarity, or whatever, are appreciated. And it''s a wiki, so just make the change yourself. <grin> - Matt
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
2007 Mar 18
1
A wish or possible?
Hi, One thing I''d like to be able to do is this... define sedfile ( $file = '''', $target = '''', $pattern = '''', $options = ''-i -n'' , onlyif = '''' ) { case $file { '''': { err ( "Require valid filename: ''$file''" ) } } case $target {
2007 Nov 07
1
A more elegant way of obtaining the major OS release number
Hello all: > We operate in an environment where we might sometimes wish to do > certain tasks based solely upon the MAJOR version number of an OS > release, disregarding the minor portion of the version number. For > instance, CentOS 4.0 through 4.5 would all be ''CentOS 4'' to some > scripts, and CentOS 5.0 and greater would all be ''CentOS 5''.
2007 Dec 10
4
Results from testing our manifests, functions and types against HEAD
Hi Luke and other people working on 0.24. I hope this is constructive. So, I have our configuration working against a checkout from git as of last night. Subject to (sorry, here''s the big but :) * external_nodes script is not being called (#951) * Custom types aren''t working unless I drop them into $rubysitedir/puppet/{type,provider}. Previously they worked in
2007 Mar 26
3
Basic help with imports and includes
Do any of you good people have a moment to help me out with my basic Puppet language skills, I''m a little new around here and getting an error I don''t yet understand. I have an RHEL4 Puppetmaster happily controlling the permissions of /etc/sudoers on an RHEL5 and SolarisX86 client. My actual environment consists of several systems in several locations. All systems need the
2007 Mar 29
7
Refering to node name (or part of node name) in a class / function
Hi, I was wondering if it is possible to gain access to the nodename as a variable, in order to refer to the name or part of it inside a class. Eg: I have a lot of sites that essentially have the same configuration, except they are in different domains and have different requirements for things like resolv.conf. I can manage this by creating a node definition for each node and specifying some
2007 May 01
8
Global Variables?
What is the view of having / not having global variables in Puppet? Facter variables are global in the sense they are defined in every scope (whereas ''normal'' variables are only available within the scope they are defined in). I could simply add a custom fact for my DoesTheServerNeedASerialConsole flag to Facter, but I''m not 100% sure I should be having the client
2007 Nov 08
3
Downloading a file into a directory that does not exist
Hello again, all: When downloading a file from the puppetmaster''s fileserver, like so: ==========SNIP========== define install_file ($mode = 0644, $owner = ''root'', $group = ''root'') { file { "${name}": source => [ "puppet://${puppetserver}/dist/files/${name}_${operatingsystem}",
2007 Nov 13
7
Exported resources & exec ?
Hi, I''m sorry if that''s a FAQ, I also know exported resources are a still experimental. So my problem might well be a design limitation of how exported resources are working. My issue: I''m trying to export a file resource that is created by an exec block. The file is exported fine and collected fine but it is always empty on the other host. The puppet snippet: class
2008 Jan 23
7
generate with spaces?
Hi, I''ve been using puppet for about a week and a half now, and it''s definitely making my life a lot easier. I''m using 0.24.1 and I''ve run into a small snag. I''m trying to write some code to make sure user home directories exist for users in LDAP. I''m trying to get their uid, gid and home directory from getent with something like: $uid =
2007 Jun 04
16
Puppet installation and observations
Greeting Puppeteers, ( I sent this from the wrong address so it may be a duplicate post after moderation ) I recently discovered puppet from the debian administration site and thought I might install it after BASHING my head against cfengine the last 3 times I tried to install it. I installed puppetmaster on my primary server and dropped puppet on a couple of xen virtuals. It worked