Re: [Puppet Users] more on classes and external files
On Tuesday 06 Jul 2010 08:42:55 christopher floess wrote: > Hi, quick question: > > I have been following the thread: "Splitting classes into separate > files" and decided to to some refactoring based on that. I have the > following file structure for a module > > modules/packages/manifests/init.pp > modules/packages/manifests/classes/redis.pp mv modules/packages/manifests/classes/redis.pp modules/packages/manifests/redis.pp > > ~/puppet_config$ cat modules/packages/manifests/init.pp > import "redis" You can remove this. > ~/puppet_config$ cat modules/packages/manifests/classes/redis.pp > class redis { > file { > "/home/adva/builds/redis_1.02-1_i386.deb": > ensure => present, > source => "puppet:///redis/redis_1.02-1_i386.deb"; > } > > file { > "/etc/redis.conf": > ensure => present; > } > > package { > "redis": > require => File["/home/adva/builds/redis_1.02-1_i386.deb"], > source => "/home/adva/builds/redis_1.02-1_i386.deb", > ensure => installed, > provider => dpkg; > } > } > > then in manifests/modules.pp I have > > ~/puppet_config$ cat manifests/modules.pp > # /etc/puppet/manifests/modules.pp > > import "base_packages" > import "base_configs" > import "users" > import "sphinx" > import "gems" > import "ree" > import "nginx" > import "puppet_client" > import "packages" And 'import "packages"' here too. Autoloader should take care of that. > puppet-ad...@servercharlie:~/puppet_config$ > > and in manifests/nodes.pp, I have > <--- snip ---> > node 'ext-b2c-sk-test' inherits default { > include b2c_test > include sk_base > include gems_sk_all > include gems_b2c_base > include ree > include packages::redis That's correct. > include nginx > include sphinx > adva_users{"application": username => "application",} > } > <--- snip ---> > > I'm getting the error: Could not retrieve catalog from remote server: > Error 400 on SERVER: Could not parse for environment production: No > file(s) found for import of 'redis' at > /home/puppet-admin/puppet_config/modules/packages/manifests/init.pp:2 > > So my question is, how do I change things in the 4 files above so that > this runs properly. > > Because of the auto-load stuff mentioned in Module standards, I've also > tried changing 'include packages::redis" to 'include redis', but that > didn't work either. IIUC with autoloader you can basically think of it as: it takes class/define name requested (e.g. from include line), converts it into a filename so, e.g.: packages -> packages/manifests/init.pp packages::redis -> packages/manifests/redis.pp packages::foo::bar -> packages/manifests/foo/bar.pp and looks that up in each dir in module path. > > Thanks in advance, > Chris -- Michael Gliwinski Henderson Group Information Services 9-11 Hightown Avenue, Newtownabby, BT36 4RT Phone: 028 9034 3319 ** The information in this email is confidential and may be legally privileged. It is intended solely for the addressee and access to the email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients, any opinions or advice contained in this e-mail are subject to the terms and conditions expressed in the governing client engagement leter or contract. If you have received this email in error please notify supp...@henderson-group.com John Henderson (Holdings) Ltd Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, BT36 4RT. Registered in Northern Ireland Registration Number NI010588 Vat No.: 814 6399 12 * -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] Puppet and Andorid
On Tuesday 10 Aug 2010 04:06:22 Rohan McGovern wrote: > They need to be managed, just like everything else. Yeah, I fully agree. Especially since puppet can simply manage what needs to be managed and leave the rest alone, it's very useful to be able to "scale it down" and run on routers, tablets, phones, etc. -- Michael Gliwinski Henderson Group Information Services 9-11 Hightown Avenue, Newtownabby, BT36 4RT Phone: 028 9034 3319 ** The information in this email is confidential and may be legally privileged. It is intended solely for the addressee and access to the email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients, any opinions or advice contained in this e-mail are subject to the terms and conditions expressed in the governing client engagement leter or contract. If you have received this email in error please notify supp...@henderson-group.com John Henderson (Holdings) Ltd Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, BT36 4RT. Registered in Northern Ireland Registration Number NI010588 Vat No.: 814 6399 12 * -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] Puppet and Andorid
On Wednesday 11 Aug 2010 03:01:07 Disconnect wrote: > Is there something I'm missing? (As an aside, 50 megs - only 3 shared - > seems to be fairly standard for memory use when idle. That -screams- "not > made for embedded" :) ..) Yes, I meant to say it *would* be nice to be able to "scale it down", as I mentioned in some other thread pure Ruby doesn't seem the best suited for this. Then again, it might be that the use case is a bit different, on a lot of small devices space, memory and processing power constraints make it hard to install additional software and especially daemons. Sometimes it's easier to just operate on those devices via SSH channel with available OS tools. It's just when I do that it usually feels like there's a lot of duplication of functionality going on. -- Michael Gliwinski Henderson Group Information Services 9-11 Hightown Avenue, Newtownabby, BT36 4RT Phone: 028 9034 3319 ** The information in this email is confidential and may be legally privileged. It is intended solely for the addressee and access to the email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients, any opinions or advice contained in this e-mail are subject to the terms and conditions expressed in the governing client engagement leter or contract. If you have received this email in error please notify supp...@henderson-group.com John Henderson (Holdings) Ltd Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, BT36 4RT. Registered in Northern Ireland Registration Number NI010588 Vat No.: 814 6399 12 * -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] Re: RFC: Make file content specification methods consistent.
On Monday 01 Nov 2010 15:28:42 jcbollinger wrote: > o sum up: > > Resolving the perceived consistency issue can be done without any > change to the File resource. It is sufficient to > > a) Fix the relative path problem for the file() function, and > b) add a string concatentation function, and > c) deprecate passing multiple arguments to template(), prefering > instead applying the new conatentation function to several single- > argument invocations of template(). > > This approach is 100% backwards-compatible, inasmuch as deprecation of > multiple arguments to template() does not imply removal of that > feature. Because the new features would all be in functions, they > would be available everywhere in manifests that functions can be > invoked, not just in File resources. Furthermore, the new mechanism > for concatenating template results would be both more expressive than > the old and, because of its reliance on a general-purpose function, > more broadly consistent than just with file() and File/source. +1 Just had the same thoughts :D -- Michael Gliwinski Henderson Group Information Services 9-11 Hightown Avenue, Newtownabby, BT36 4RT Phone: 028 9034 3319 ** The information in this email is confidential and may be legally privileged. It is intended solely for the addressee and access to the email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients, any opinions or advice contained in this e-mail are subject to the terms and conditions expressed in the governing client engagement leter or contract. If you have received this email in error please notify supp...@henderson-group.com John Henderson (Holdings) Ltd Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, BT36 4RT. Registered in Northern Ireland Registration Number NI010588 Vat No.: 814 6399 12 * -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] Help with LDAP, Users, and Puppet..
On Tuesday 02 Nov 2010 01:53:34 Bruce Richardson wrote: > nsscache is probably at fault. Try removing it from nsswitch on > a machine which has shown this problem and then see how that affects > things. Why do you think nsscache could be a problem? The reason I'm asking is I'm having some issues with nss_ldap + nscd (on CentOS) as well and was actually going to look into nsscache as possible workaround. -- Michael Gliwinski Henderson Group Information Services 9-11 Hightown Avenue, Newtownabby, BT36 4RT Phone: 028 9034 3319 ** The information in this email is confidential and may be legally privileged. It is intended solely for the addressee and access to the email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients, any opinions or advice contained in this e-mail are subject to the terms and conditions expressed in the governing client engagement leter or contract. If you have received this email in error please notify supp...@henderson-group.com John Henderson (Holdings) Ltd Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, BT36 4RT. Registered in Northern Ireland Registration Number NI010588 Vat No.: 814 6399 12 * -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] Help with LDAP, Users, and Puppet..
On Tuesday 02 Nov 2010 12:44:38 Bruce Richardson wrote: > On Tue, Nov 02, 2010 at 09:35:24AM +0000, Michael Gliwinski wrote: > > On Tuesday 02 Nov 2010 01:53:34 Bruce Richardson wrote: > > > nsscache is probably at fault. Try removing it from nsswitch on > > > a machine which has shown this problem and then see how that affects > > > things. > > > > Why do you think nsscache could be a problem? > > It and nscd often are. Better to ensure that your LDAP directory is > resilient and responsive. Configure pam and nsswitch so that you can > still get into a box as a non-LDAP user in the worst case scenario where > LDAP is inaccessible. Caching the directory just causes a whole new > special kind of latency issues while making problems harder to debug. Hmm, I know what you mean, but then without any caching this can mean quite a load on the LDAP servers considering even simple 'ls -l' has to go over network to resolve UIDs/GIDs. Anyway, do you happen to know of a good guide, howto, etc. for nss_ldap configuration (specifically on CentOS with AD)? I'm thinking maybe client configuration is at fault but haven't yet encountered a good guide that would explain what is needed and why (e.g. many also mention winbind, not sure what for, also one of our admins here was playing with Kerberos which seems isn't needed and could be contributing to the issues). -- Michael Gliwinski Henderson Group Information Services 9-11 Hightown Avenue, Newtownabby, BT36 4RT Phone: 028 9034 3319 ** The information in this email is confidential and may be legally privileged. It is intended solely for the addressee and access to the email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients, any opinions or advice contained in this e-mail are subject to the terms and conditions expressed in the governing client engagement leter or contract. If you have received this email in error please notify supp...@henderson-group.com John Henderson (Holdings) Ltd Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, BT36 4RT. Registered in Northern Ireland Registration Number NI010588 Vat No.: 814 6399 12 * -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] Re: RFC: Make file content specification methods consistent.
On Tuesday 02 Nov 2010 15:06:19 Nigel Kersten wrote: > On Tue, Nov 2, 2010 at 6:34 AM, jcbollinger wrote: > > On Nov 1, 7:07 pm, Nigel Kersten wrote: > >> It would be great if someone could update the original bug with the > >> position we've come to, otherwise I'll get to it in the next few days. > > > > Done. > > > > > > John > > Thanks. There's one thing I'm not quite clear on. > > This proposal means we have concatenation and find-first-existing > support for the source parameter, and concatenation for the template > function, but how are we proposing we provide find-first-existing > support for the template and file functions? Or are we dropping that > goal? I believe that was by either passing an array or multiple arguments, no? E.g.: find-first-existing: file('foo', 'bar') template('foo.erb', 'bar.erb') concatenation: concat(file('foo'), file('bar')) concat(template('foo.erb'), template('bar.erb')) that way you can even mix them ;) concat(file('header'), template("foo.$host.erb", "foo.erb")) -- Michael Gliwinski Henderson Group Information Services 9-11 Hightown Avenue, Newtownabby, BT36 4RT Phone: 028 9034 3319 ** The information in this email is confidential and may be legally privileged. It is intended solely for the addressee and access to the email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients, any opinions or advice contained in this e-mail are subject to the terms and conditions expressed in the governing client engagement leter or contract. If you have received this email in error please notify supp...@henderson-group.com John Henderson (Holdings) Ltd Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, BT36 4RT. Registered in Northern Ireland Registration Number NI010588 Vat No.: 814 6399 12 * -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] Re: RFC: Make file content specification methods consistent.
On Tuesday 02 Nov 2010 16:43:25 Nigel Kersten wrote: > >> I believe that was by either passing an array or multiple arguments, no? > >> E.g.: > >> > >> find-first-existing: > >> > >> file('foo', 'bar') > >> template('foo.erb', 'bar.erb') > >> > >> concatenation: > >> > >> concat(file('foo'), file('bar')) > >> concat(template('foo.erb'), template('bar.erb')) > >> > >> that way you can even mix them ;) > >> > >> concat(file('header'), template("foo.$host.erb", "foo.erb")) > > > > The proposal I was supporting (and the one in the bug tracker) retained > > backward compatibility which means that passing more than one file to > > template() still concatenates. That is deprecated though. > > > > *) Would creating a function that says, 'return the first argument that > > doesn't throw an exception' be useful? *) Is it even feasible to write? > > maybe... I'm having trouble thinking of a decent name for this though :) how about just first() or first_existing() ? > > *) Also, I'm assuming that file() and template() throw an exception if > > the file doesn't exist. Does anyone know if that's true? > > From memory they do, but I'll have to double check. > > > *) Also, what would you name this function? > > > > I'm thinking that if we do take this approach, it should be split off > > into another ticket. > > I kind of disagree with splitting it off. > > Perhaps I didn't express myself well, but my main impetus was to make > the source/file/template data specifications all support the > find-first-existing and concatenation functionality in a sane and > consistent manner. Well, I suppose separating both concatenation and find-first-existing functionalities from source/file()/template() does get you there (flexible and consitent) at the cost of being little more verbose. -- Michael Gliwinski Henderson Group Information Services 9-11 Hightown Avenue, Newtownabby, BT36 4RT Phone: 028 9034 3319 ** The information in this email is confidential and may be legally privileged. It is intended solely for the addressee and access to the email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients, any opinions or advice contained in this e-mail are subject to the terms and conditions expressed in the governing client engagement leter or contract. If you have received this email in error please notify supp...@henderson-group.com John Henderson (Holdings) Ltd Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, BT36 4RT. Registered in Northern Ireland Registration Number NI010588 Vat No.: 814 6399 12 * -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
[Puppet Users] Referencing resources by alias
Hello everyone, I just encountered this and was wondering if this is expected? defined_test.pp: class foo { file { 'deftest': path => '/tmp/deftest.tmp', ensure => present, alias => 'aliastest' } $def_title = defined(File['deftest']) $def_path = defined(File['/tmp/deftest.tmp']) $def_alias = defined(File['aliastest']) notice("Results:\n\tdefined(title): ${def_title}\n\tdefined(path): ${def_path}\n\tdefined(alias): ${def_alias}") } node default { include foo } This returns: # puppet --debug ./defined_test.pp notice: Scope(Class[foo]): Results: defined(title): true defined(path): false defined(alias): false ... Is this expected? Why would File['aliastest'] not work when referencing the resource for 'defined()' function call and yet it would work when referencing the resource in e.g. 'require' property of another resource? Any ideas? Thanks, Michael -- Michael Gliwinski Henderson Group Information Services 9-11 Hightown Avenue, Newtownabby, BT36 4RT Phone: 028 9034 3319 ** The information in this email is confidential and may be legally privileged. It is intended solely for the addressee and access to the email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients, any opinions or advice contained in this e-mail are subject to the terms and conditions expressed in the governing client engagement leter or contract. If you have received this email in error please notify supp...@henderson-group.com John Henderson (Holdings) Ltd Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, BT36 4RT. Registered in Northern Ireland Registration Number NI010588 Vat No.: 814 6399 12 * --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~--~~~~--~~--~--~---
[Puppet Users] Re: Running puppet on manifest modificattion
On Monday 24 August 2009 11:35:01 sameer wrote: > Hi All, > > I am new to Puppet and recently switched from Cfengine. I used it to > make to propagate a configuration file. The manifest involved wgetting > a file and restarting the concerned daemon. As a result of this within > a couple of hours I got flooded with alerts because the daemon kept > restarting. That depends on how are you doing this in puppet. If you're using 'wget' in exec resource then indeed that's what will happen (see below). The proper way would be to use file and service resources: file { '/etc/daemon_config_file': ensure => present, # ... owner, group, mode, etc. source => 'puppet:///.../daemon_config_file', notify => Service['daemon'], } service { 'daemon': ensure => running } The 'notify' metaparam will cause the service to be restarted only if file has changed. > > I am aware that by default puppet runs the manifest every 30mins and > that value is adjustable but I want it to run only when the manifest > has changed, like in cfengine. While puppet indeed runs every 30 mins by default, it only applies changes if there's actually something to apply. Which means the configuration has to be idempotent so puppet can tell if a change has to be applied or not. Most resources handle that by default, in case of exec resources you have to do it by hand, e.g. by specifying one of 'onlyif', 'unless', 'creates', etc. metaparams. Have a look at type reference here: http://reductivelabs.com/trac/puppet/wiki/TypeReference > > Sameer > > -- Michael Gliwinski Henderson Group Information Services 9-11 Hightown Avenue, Newtownabby, BT36 4RT Phone: 028 9034 3319 ** The information in this email is confidential and may be legally privileged. It is intended solely for the addressee and access to the email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients, any opinions or advice contained in this e-mail are subject to the terms and conditions expressed in the governing client engagement leter or contract. If you have received this email in error please notify supp...@henderson-group.com John Henderson (Holdings) Ltd Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, BT36 4RT. Registered in Northern Ireland Registration Number NI010588 Vat No.: 814 6399 12 * --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~--~~~~--~~--~--~---
[Puppet Users] Re: Users without shadow
Hi Mark, We also use the combination of AD/LDAP + Puppet and I just checked and I don't have any entries in shadow file for any AD users. I also checked the provider code and in fact AFAICS it first checks if any changes need to be applied (by comparing property values specified in manifest to values returned by the provider). Note that in my manifests I only have user/group resources for those coming from AD defined for dependency specification, without any attributes like UID or GID set on them. What's your usage of them looks like? BTW I'm running 0.24.8 on CentOS-5. Michael On Friday 28 August 2009 15:29:38 Gajillion wrote: > All, > We use LDAP authentication against Active Directory on our Linux > systems. If a user is not in AD, they don't get into authenticated. > We remove all AD authenticated user's shadow entry to keep the shadow > expirations from interfering with authentication. However, the "user" > type in puppet insists that a user have a shadow entry and re-creates > it on every run. This forces us to put another bit of code that > removes the shadow entry that Puppet just added. > > This gives us the functionality that we need, but it also creates a > whole bunch of notices and a flurry of unnecessary activity every time > Puppet runs. Anyone have any ideas on who to create and manage users > without forcing them to have a shadow entry at all? > > Mark > -- Michael Gliwinski Henderson Group Information Services 9-11 Hightown Avenue, Newtownabby, BT36 4RT Phone: 028 9034 3319 ** The information in this email is confidential and may be legally privileged. It is intended solely for the addressee and access to the email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients, any opinions or advice contained in this e-mail are subject to the terms and conditions expressed in the governing client engagement leter or contract. If you have received this email in error please notify supp...@henderson-group.com John Henderson (Holdings) Ltd Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, BT36 4RT. Registered in Northern Ireland Registration Number NI010588 Vat No.: 814 6399 12 * --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~--~~~~--~~--~--~---
[Puppet Users] Re: /etc puppet or some of the directories can't be symlinks.
On Thursday 10 September 2009 03:42:31 Tim Uckun wrote: > > Is this really that big of a deal? You can use puppet.conf to > > configure where the directories will be, so at worst you have a single > > file in /etc/puppet/puppet.conf, or you can start your daemons with -- > > config /my/puppet.conf. > > No it's not a big deal and I have done just that. > > I just wanted to report it in case somebody else runs into it. > Indeed it's not a problem but more like a surprising behaviour. I've run into that myself a while back. -- Michael Gliwinski Henderson Group Information Services 9-11 Hightown Avenue, Newtownabby, BT36 4RT Phone: 028 9034 3319 ** The information in this email is confidential and may be legally privileged. It is intended solely for the addressee and access to the email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients, any opinions or advice contained in this e-mail are subject to the terms and conditions expressed in the governing client engagement leter or contract. If you have received this email in error please notify supp...@henderson-group.com John Henderson (Holdings) Ltd Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, BT36 4RT. Registered in Northern Ireland Registration Number NI010588 Vat No.: 814 6399 12 * --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~--~~~~--~~--~--~---
[Puppet Users] Re: creating custom types
On Wednesday 30 September 2009 06:39:05 Carl Caum wrote: > This is always a good starting place: > > http://reductivelabs.com/trac/puppet/wiki/Development/CreatingCustomTypes > > On Wed, Sep 30, 2009 at 12:35 AM, Matt Delves wrote: > > Hey Folks, > > I'm after some documentation about creating a custom puppet type. > > Particularly creating test cases for the type as well. > > > > Thanks, > > Matt Delves Unfortunatelly there's no info there regarding tests there and since tests are required to consider including a type/provider in Puppet I agree that it would be useful to have something more. -- Michael Gliwinski Henderson Group Information Services 9-11 Hightown Avenue, Newtownabby, BT36 4RT Phone: 028 9034 3319 ** The information in this email is confidential and may be legally privileged. It is intended solely for the addressee and access to the email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients, any opinions or advice contained in this e-mail are subject to the terms and conditions expressed in the governing client engagement leter or contract. If you have received this email in error please notify supp...@henderson-group.com John Henderson (Holdings) Ltd Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, BT36 4RT. Registered in Northern Ireland Registration Number NI010588 Vat No.: 814 6399 12 * --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~--~~~~--~~--~--~---
[Puppet Users] Re: Using variables in virtual resources
On Friday 02 October 2009 07:35:57 Erling wrote: > On 28 Sep, 19:44, Eric Gerlach wrote: > > You might be able to do something like: > > > > realize User[kenneth] > > > > User[kenneth] { > > groups => $server_type ? { > > typeA => "wheel", > > default => undef, > > } > > > > } > > > > to realize it the way you want. Haven't tried anything like that though. > > Maybe someone else can comment if it works. > > I have tried this: > > > node 'mynode.local' { > > $server_type = "webserver" > > adduser { "joe": > server_type => $server_type, > user_name => "joe", > } > } > > define adduser ( $user_name, $server_type ) { > > realize User[$user_name] > realize Group[$user_name] > > User[$user_name] { > groups => $server_type ? { > webserver => wheel, > default => $user_name, > }, > } > } > > > > @group { "joe": > ensure => present, > gid => 1234, > allowdupe => false > } > > @user {"joe": > ensure => present, > managehome => true, > uid => 1234, > gid => 1234, > home => "/home/joe", > shell => "/bin/bash", > comment => "Joe", > password => '$1$ij21Zc04$MwyqTQP2fXc0BqMIjtz5b/', > } > > When running puppetd on mynode.local I get this message: > > notice: Ignoring cache > err: Could not retrieve catalog: Only subclasses can override > parameters at /etc/puppet/manifests/classes/adduser.pp:11 > warning: Not using cache on failed catalog > > Best regards, > > Erling Ringen Elvsrud > You should try re-organizing this so that you have your resources (here users) defined in a class, e.g. class all_users { @user {"joe": ensure => present, ... groups => $servertype ? { webserver => wheel, default => $user_name } } } node 'mynode.local' { $server_type = "webserver" incldue all_users } This is a simpliest example, you may still use a define and have to watch out for scoping rules, but that's the general idea. Regards, -- Michael Gliwinski Henderson Group Information Services 9-11 Hightown Avenue, Newtownabby, BT36 4RT Phone: 028 9034 3319 ** The information in this email is confidential and may be legally privileged. It is intended solely for the addressee and access to the email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients, any opinions or advice contained in this e-mail are subject to the terms and conditions expressed in the governing client engagement leter or contract. If you have received this email in error please notify supp...@henderson-group.com John Henderson (Holdings) Ltd Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, BT36 4RT. Registered in Northern Ireland Registration Number NI010588 Vat No.: 814 6399 12 * --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~--~~~~--~~--~--~---
[Puppet Users] Re: Puppet way to manage a central file?
On Friday 02 October 2009 11:06:39 Aurelien Degremont wrote: > Thomas Bellman a écrit : > > Aurelien Degremont wrote: > >> How do you deal with a file, like /etc/sysconfig/network which have > >> content composed from different aspects (could be network, nfs, nis, > >> ...). So managed by various modules but all > of them should add its > >> own stuff to the same file. > >> > >> What is your elegant way to deal with this? > > > > Edit the individual settings using e.g. Augeas. Preferably wrap it in > > a define, so you don't have to deal with the augeas type directly every > > time you want to change something in /etc/sysconfig. > > I put /etc/sysconfig/network as an example. AFAIK, unfortunately, Augeas > only handles known files (existing lenses). If we trty to handle > /etc/our_local_config_file, it is not so easy. I usually handle that by distributing custom augeas lenses with puppet and putting them in /usr/share/augeas/lenses/. This isn't actually very hard as most of those lenses are slightly customized versions of lenses bundled with augeas (very often only with adjusted filter to include the file I need to change). That is unless you have a not-yet-supported config file type or a really hard to handle one. Suppose augeas could be a bit more flexible with regards to the file filters, or at least allowing to modify it on runtime :) -- Michael Gliwinski Henderson Group Information Services 9-11 Hightown Avenue, Newtownabby, BT36 4RT Phone: 028 9034 3319 ** The information in this email is confidential and may be legally privileged. It is intended solely for the addressee and access to the email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients, any opinions or advice contained in this e-mail are subject to the terms and conditions expressed in the governing client engagement leter or contract. If you have received this email in error please notify supp...@henderson-group.com John Henderson (Holdings) Ltd Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, BT36 4RT. Registered in Northern Ireland Registration Number NI010588 Vat No.: 814 6399 12 * --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~--~~~~--~~--~--~---
[Puppet Users] Re: Using variables in virtual resources
On Friday 02 October 2009 13:41:44 Michael Gliwinski wrote: > On Friday 02 October 2009 07:35:57 Erling wrote: > > On 28 Sep, 19:44, Eric Gerlach wrote: > > > You might be able to do something like: > > > > > > realize User[kenneth] > > > > > > User[kenneth] { > > > groups => $server_type ? { > > > typeA => "wheel", > > > default => undef, > > > } > > > > > > } > > > > > > to realize it the way you want. Haven't tried anything like that > > > though. Maybe someone else can comment if it works. > > > > I have tried this: > > > > > > node 'mynode.local' { > > > > $server_type = "webserver" > > > > adduser { "joe": > > server_type => $server_type, > > user_name => "joe", > > } > > } > > > > define adduser ( $user_name, $server_type ) { > > > > realize User[$user_name] > > realize Group[$user_name] > > > > User[$user_name] { > > groups => $server_type ? { > > webserver => wheel, > > default => $user_name, > > }, > > } > > } > > > > > > > > @group { "joe": > > ensure => present, > > gid => 1234, > > allowdupe => false > > } > > > > @user {"joe": > > ensure => present, > > managehome => true, > > uid => 1234, > > gid => 1234, > > home => "/home/joe", > > shell => "/bin/bash", > > comment => "Joe", > > password => '$1$ij21Zc04$MwyqTQP2fXc0BqMIjtz5b/', > > } > > > > When running puppetd on mynode.local I get this message: > > > > notice: Ignoring cache > > err: Could not retrieve catalog: Only subclasses can override > > parameters at /etc/puppet/manifests/classes/adduser.pp:11 > > warning: Not using cache on failed catalog > > > > Best regards, > > > > Erling Ringen Elvsrud > > You should try re-organizing this so that you have your resources (here > users) defined in a class, e.g. > > class all_users { > @user {"joe": > ensure => present, > ... > groups => $servertype ? { > webserver => wheel, > default => $user_name > } > } > } > > node 'mynode.local' { > $server_type = "webserver" > incldue all_users > } > > This is a simpliest example, you may still use a define and have to watch > out for scoping rules, but that's the general idea. > > Regards, Aaand of course I made a mistake :O when you're using virtual resources you have to realize them somewhere, e.g.: class all_users { @user {"joe": ensure => present, ... groups => $servertype ? { webserver => wheel, default => $user_name } } } node 'mynode.local' { $server_type = "webserver" incldue all_users realize(User["joe"]) } Again, note that this is simplistic, you usually don't realize resources directly in the nodes. -- Michael Gliwinski Henderson Group Information Services 9-11 Hightown Avenue, Newtownabby, BT36 4RT Phone: 028 9034 3319 ** The information in this email is confidential and may be legally privileged. It is intended solely for the addressee and access to the email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients, any opinions or advice contained in this e-mail are subject to the terms and conditions expressed in the governing client engagement leter or contract. If you have received this email in error please notify supp...@henderson-group.com John Henderson (Holdings) Ltd Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, BT36 4RT. Registered in Northern Ireland Registration Number NI010588 Vat No.: 814 6399 12 * --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~--~~~~--~~--~--~---
[Puppet Users] Re: Arbitrary 3rd party installers
On Wednesday 21 October 2009 09:17:04 Andrew S wrote: > On Oct 21, 6:11 am, Luke Kanies wrote: > > The only real thing I can recommend is either 1) package the software > > yourself (by far the best option) or 2) use a defined type to do a > > wget, install, and rm of the tarball. Really, if you look at the > > Blastwave pkg-get script, that's pretty much what it does, so you'd be > > walking in the footsteps of giants or whatever. > > Right, the main issue with option 1) is that to do it properly it's a > lot of work to extracting out the behaviour of the installer script/ > binary/whatever, and there's no garauntee that I will pick up all the > changes or potential changes - e.g. a case statement that installs a > different library for different OS revisions. This is a lot of work > per package, and it's not garaunteed to be supported by the vendor > (who should have done this work themselves :/). I could just build a > pkg/rpm (we're a Solaris/Redhat shop) wrapper around the installer > itself, but that doesn't fit either of the frameworks correctly - the > package manifest will be the install files, which should be removed > from the system. I have seen one instance where an rpm wrapper is > used and the last thing it does in postinstall is uninstall itself. > Seems kludgy to me. Absolutely agree with that. I'm working on something like that for Progress OpenEdge and their installer will even install different things depending on what license/options you supply it with. A slight variation may be to build a wrapper package similar to the ones used for e.g. adobe flash, etc. That is, one which in itself contains no files, but when installed it downloads the installer and automates it. This still poses a problem in cases like Progress (i.e. different options, different result) but as long as you could work out a certain limited set of variations you could just build multiple packages from one spec file (each providing one set). > > Option 2) is what I was suggesting, but wanted to use a filebucket > rather than wget, but if that's not workable I'll stick with wget. I > was really hoping to be able to avoid having to have external > repositories of software though. You don't see any case for a > provider (exec or package) within puppet to meet this need? Two questions here. By using filebucket do you mean the internal puppet fileserver (with 'puppet://' URLs)? Also, a provider could be a good idea, but do you think it could be generic enough to support 3rd party installers? What's the behaviour of those you're using (e.g. any interactivity, batch mode, command line options, response files, etc.)? -- Michael Gliwinski Henderson Group Information Services 9-11 Hightown Avenue, Newtownabby, BT36 4RT Phone: 028 9034 3319 ** The information in this email is confidential and may be legally privileged. It is intended solely for the addressee and access to the email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients, any opinions or advice contained in this e-mail are subject to the terms and conditions expressed in the governing client engagement leter or contract. If you have received this email in error please notify supp...@henderson-group.com John Henderson (Holdings) Ltd Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, BT36 4RT. Registered in Northern Ireland Registration Number NI010588 Vat No.: 814 6399 12 * --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~--~~~~--~~--~--~---
[Puppet Users] Re: Conditional based on existence of a file
On Thursday 29 October 2009 05:00:34 John Philips wrote: > Perhaps I just need to approach it a different way: create a new type and > put all my custom logic in there? I think this may indeed be the direction you could explore. The manifests are compiled into resources and their parameters on the server and applied on the client. So if how a resource is applied depends on current environment of the client it makes sense to have a custom resource type for this resource which would then be able to make decisions when applying itself. -- Michael Gliwinski Henderson Group Information Services 9-11 Hightown Avenue, Newtownabby, BT36 4RT Phone: 028 9034 3319 ** The information in this email is confidential and may be legally privileged. It is intended solely for the addressee and access to the email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients, any opinions or advice contained in this e-mail are subject to the terms and conditions expressed in the governing client engagement leter or contract. If you have received this email in error please notify supp...@henderson-group.com John Henderson (Holdings) Ltd Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, BT36 4RT. Registered in Northern Ireland Registration Number NI010588 Vat No.: 814 6399 12 * --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~--~~~~--~~--~--~---
Re: [Puppet Users] Configuring Networking
On Tuesday 15 December 2009 23:39:31 Douglas Garstang wrote: > And... even then I'd be requiring a definition, not a class. Is that > even valid? How would the syntax look? Definition is like a custom type so define foo() {} foo {'bar':} file {'/tmp/bar': require => Foo['bar'] } -- Michael Gliwinski Henderson Group Information Services 9-11 Hightown Avenue, Newtownabby, BT36 4RT Phone: 028 9034 3319 ** The information in this email is confidential and may be legally privileged. It is intended solely for the addressee and access to the email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients, any opinions or advice contained in this e-mail are subject to the terms and conditions expressed in the governing client engagement leter or contract. If you have received this email in error please notify supp...@henderson-group.com John Henderson (Holdings) Ltd Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, BT36 4RT. Registered in Northern Ireland Registration Number NI010588 Vat No.: 814 6399 12 * -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] Proposals for modules naming conventions
Hi, On Thursday 17 December 2009 16:15:17 Al @ Lab42 wrote: > Hallo *, > at the Puppet Camp there has been some discussion about modules > standards and naming conventions. > I might have missed some relevant bits in the last months of personal > absence from the list so I'm not sure if this topic has evolved or has > been discussed more deeply. > > I take this occasion to sum up what seem somehow the community > standards and propose something else for, simply, the conventions we > might try to agree on class names. > I take as reference what is written in > http://reductivelabs.com/trac/puppet/wiki/ModuleStandards introduction what > are my personal proposals > > COMMUNITY "STANDARDS" SUM-UP (?) > > 1- a class for an application, sharing the same name. (IE: apache > (not httpd) for managing Apache) > Still I wonder why I (and many) use ssh instead of openssh :-) +1 good point about openssh > 2- distinct names for client and server, where applicable (IE: > samba::client , samba::server) +1 > 3- FROM WIKI: Operating system differences should be specified in > variables in a case at the start of the module, as follows: > class ssh::server { > case $operatingsystem { >"freebsd","openbsd": { > $sshservice = "sshd" > } > debian: { >$sshservice = "ssh" > } > } > # use a constant title to facilitate stable relations > service { "ssh::server": > name => $sshservice, > ensure => running, > enable => true, > } > } +1, that's what I use usually > I personally prefer something like (not avoid unnecessary internal > variables in modules): > class ssh::server { > service { "ssh::server": > name => $operatingsystem ? { > debian => "ssh", > default => "sshd", > } > ensure => running, > enable => true, > } > } > > but that affects the class internals and is not relevant for the name > itself. I still prefer the former as OS differences are encapsulated in one place. This one may be better for really small differences. > 4- FROM WIKI: Bigger operating system differences should be split out > into their respective classes: > class ssh::server::common { > service { 'ssh::server': ... } > } > class ssh::server::debian inherits ssh::server::common { > Service['ssh::server'] { name => 'ssh' } > } > class ssh::server { > include "ssh::server::$operatingsystem" > } +1 > 5- Specific variations on the normal behaviour of an application > should be specified as subclasses (IE: samba::pdc or samba::ldap) How does that relate to ::server and ::client above? E.g. if samba::pdc implies samba::server wouldn't it be better if it was samba::server::pdc? > 6- PROPOSAL for service or application status (based mostly on what > I've seen around). > - If you want an application removed provide something like: > apache::absent inherits apache { > Package["apache"] { > ensure => absent, > } > } > > - If you want an application stopped provide something like: > apache::stopped inherits apache { > Service["apache"] { > ensure => stopped, > } > } > > - If you want an application not enable at boot time provide something > like: > apache::disabled inherits apache { > Service["apache"] { > enable => false, > } > } Didn't need those yet, but makes sense. > 7- PROPOSAL for general class configuration define (based on augeas or > other inline modificators) > define ssh::config ($value) { > > # Augeas version. > augeas { > "sshd_config_$name": > context => $operatingsystem ? { > default => "/files/etc/ssh/sshd_config", > }, > changes => "set $name $value", > onlyif => "get $name != $value", > # onlyif => "match $name/*[.='$value'] size == 0", > } > > # Davids' replaceline version (to fix) > # replaceline { > # "sshd_config_$name": > # file => "/etc/ssh/sshd_config", > # pattern => "$name", > # replacement => "^$name $value", > # } > } > > This define can be used in a class like > class ssh::eal4 { > > # Cripto settings > ssh::config { Protocol: > value => "2", > } > > ssh::config { Ciphers: > value => "3des-cbc", > } > > # X11 forwarding (You MAY allow) > ssh::config { X11Forwarding: > value => "no", > } > [] > } This makes sense, one problem with that however is that this creates a resource for each option. So AFAIK for augeas that means the code (opening the file, trying and appying changes) will be executed as many times as you have options. Perhaps when hashes are available using them to map (key, value) pairs to augeas set commands would make sense. > 8- PROPOSAL (don't think it will be widely liked): Variables names > needed for module configuration (the ones used in templates, for > example) should have a my_
Re: [Puppet Users] Re: Proposals for modules naming conventions
On Thursday 17 December 2009 18:58:50 Al @ Lab42 wrote: > > > 7- PROPOSAL for general class configuration define (based on augeas or > > > other inline modificators) > > > define ssh::config ($value) { > > > > > > # Augeas version. > > > augeas { > > > "sshd_config_$name": > > > context => $operatingsystem ? { > > > default => "/files/etc/ssh/sshd_config", > > > }, > > > changes => "set $name $value", > > > onlyif => "get $name != $value", > > > # onlyif => "match $name/*[.='$value'] size == 0", > > > } > > > > > > # Davids' replaceline version (to fix) > > > # replaceline { > > > # "sshd_config_$name": > > > # file => "/etc/ssh/sshd_config", > > > # pattern => "$name", > > > # replacement => "^$name $value", > > > # } > > > } > > > > > > This define can be used in a class like > > > class ssh::eal4 { > > > > > > # Cripto settings > > > ssh::config { Protocol: > > > value => "2", > > > } > > > > > > ssh::config { Ciphers: > > > value => "3des-cbc", > > > } > > > > > > # X11 forwarding (You MAY allow) > > > ssh::config { X11Forwarding: > > > value => "no", > > > } > > > [] > > > } > > > > This makes sense, one problem with that however is that this creates a > > resource for each option. So AFAIK for augeas that means the code > > (opening the file, trying and appying changes) will be executed as many > > times as you have options. > > > > Perhaps when hashes are available using them to map (key, value) pairs to > > augeas set commands would make sense. > > That's a point, but it actually doesn't affect the naming convention, > but how singular lines modifications are implemented. > At the moment I prefer to use augeas on a puppet generated file of > "augeas commands", that is served as a file resource and subscribes an > exec that runs augeas using that file as a "source" (this has the > advantage that you can use augeas on a file in an arbitrary path, > which is currently still not possibile, even if a patch on the augeas > type for this is already done and ready the the next release). > In any case, HOW you manage to get the line configured is not what I > wanted to discuss (even if this is always a very interesting and > challenging topic), I just seek for naming standards ;-) Ah, yes, I got carried away there ;P Naming is definitely OK there, apart from maybe using openssh instead of ssh (in this particular example) as per your suggestion. > > > 8- PROPOSAL (don't think it will be widely liked): Variables names > > > needed for module configuration (the ones used in templates, for > > > example) should have a my_ prefix, in order to easily distinguish them > > > from fact variables. > > > > Yeah, not really ;) I do however use ${APPNAME}_ or ${CLASSNAME}_ prefix > > for variables which a class treats as parameters. > > I retire my proposal. > What you've written, and DavidS has confirmed, is probaly more > suitable (and it's actually what I used to do, some time ago :-! ) Cool. I mostly use it to prevent clashes with variables for other modules/classes but I think it would most likely also handle facter variables. ** The information in this email is confidential and may be legally privileged. It is intended solely for the addressee and access to the email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients, any opinions or advice contained in this e-mail are subject to the terms and conditions expressed in the governing client engagement leter or contract. If you have received this email in error please notify supp...@henderson-group.com John Henderson (Holdings) Ltd Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, BT36 4RT. Registered in Northern Ireland Registration Number NI010588 Vat No.: 814 6399 12 * -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] Re: Class not compiled - help!
On Tuesday 29 December 2009 16:30:58 Ben wrote: > ok so just to confirm, if I understand correctly classes will not be > evaluted unless they are used within an include. yes > I've restored my site.pp so now it's go two classes, "files1" and > "files2" both managing file resources. > > I've also specified all nodes using the default node function, all > nodes should include the "appserver" class (which requires files1 and > files2 classes) see below > (I've upgraded my puppet version 24.8 which supports multiple class > relationships) > > [r...@xldn1564vdap manifests]# cat /etc/puppet/manifests/site.pp > node default { > include appserver > } > > class appserver { > service { "appserver": > require => Class ["files1", "files2"] > } > } > > class files1 { > file { "/etc/motd": > group => "puppet", > } > } > > class files2 { > file { "/etc/puppet/facts.conf": > group => "puppet", > } > } > > But on testing it fails to find the classes files1 or files2 Because you're not including them anywhere. 'require' is only used to specify ordering, i.e. here that resources in class 'files1' and 'files2' are applied before Service['appserver'] because it requires them. What you need in this example is sth more like class appserver { include files1 include files2 service { 'appserver': require => Class['files1', 'files2'] } } -- Michael Gliwinski Henderson Group Information Services 9-11 Hightown Avenue, Newtownabby, BT36 4RT Phone: 028 9034 3319 ** The information in this email is confidential and may be legally privileged. It is intended solely for the addressee and access to the email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients, any opinions or advice contained in this e-mail are subject to the terms and conditions expressed in the governing client engagement leter or contract. If you have received this email in error please notify supp...@henderson-group.com John Henderson (Holdings) Ltd Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, BT36 4RT. Registered in Northern Ireland Registration Number NI010588 Vat No.: 814 6399 12 * -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] Re: Errror on file reference with multiple file sources and missing file match
On Thursday 31 December 2009 15:17:56 John Vestrum wrote: > I too am trying to implement this kind of logic. It would be very > useful if I could do: > > source => [ "puppet:///path/file.$hostname", undef ] > > But this fails with "Parameter source failed: Could not understand > source undef: private method `gsub' called for :undef:Symbol". I could > use a selector: > > source => $hostname ? { >thishost => "puppet:///path/file.$hostname", >thathost => "puppet:///path/file.$hostname", >default => undef, > } > > But this requires the hostnames to be put in the manifest; if the > first form worked I could just drop the files in place without having > to add to the manifest each time. Has anyone figured out a way to make > this work? I use a workaround with an always existing empty file, like: source => [ "puppet:///path/file.$hostname", "puppet:///shared/dummy_empty_file_for_workaround" ] where that dummy_empty_file_for_workaround always exists in the shared fs mount and is size 0 (i.e. empty). This is not always suitable I guess, but I haven't found a better way. -- Michael Gliwinski Henderson Group Information Services 9-11 Hightown Avenue, Newtownabby, BT36 4RT Phone: 028 9034 3319 ** The information in this email is confidential and may be legally privileged. It is intended solely for the addressee and access to the email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients, any opinions or advice contained in this e-mail are subject to the terms and conditions expressed in the governing client engagement leter or contract. If you have received this email in error please notify supp...@henderson-group.com John Henderson (Holdings) Ltd Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, BT36 4RT. Registered in Northern Ireland Registration Number NI010588 Vat No.: 814 6399 12 * -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
[Puppet Users] Syntax error in ssh::auth module?
Hello Andrew, I'm getting a syntax error when trying to use the ssh::auth module ("Syntax error at '{'; expected '}' at .../auth.pp:111"). It looks like it's something to do with parameters after a collection, i.e. line 111 is: if $ensure { Ssh_auth_key_client <| title == $title |> { ensure => $ensure } } I've had a quick look in puppet documentation and can't find reference (e.g. in language tutorial, etc.) to that syntax. I also searched the mailing lists and found something in unrelated discussion on dev list from which I gathered that it is a valid syntax. Is it something new (i.e. newer than 0.24.8)? Should ssh::auth work on 0.24.8? BTW, I gather the above should be equivalent to: if $ensure { Ssh_auth_key_client[$title] { ensure => $ensure } } yes? Thanks, Michael -- Michael Gliwinski Henderson Group Information Services 9-11 Hightown Avenue, Newtownabby, BT36 4RT Phone: 028 9034 3319 ** The information in this email is confidential and may be legally privileged. It is intended solely for the addressee and access to the email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients, any opinions or advice contained in this e-mail are subject to the terms and conditions expressed in the governing client engagement leter or contract. If you have received this email in error please notify supp...@henderson-group.com John Henderson (Holdings) Ltd Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, BT36 4RT. Registered in Northern Ireland Registration Number NI010588 Vat No.: 814 6399 12 * -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] Syntax error in ssh::auth module?
On Thursday 18 Feb 2010 16:51:38 Andrew Schulman wrote: > > Hello Andrew, > > > > I'm getting a syntax error when trying to use the ssh::auth module > > ("Syntax error at '{'; expected '}' at .../auth.pp:111"). It looks like > > it's something to do with parameters after a collection, i.e. line 111 > > is: > > > > if $ensure { Ssh_auth_key_client <| title == $title |> { ensure => > > $ensure } } > > > > I've had a quick look in puppet documentation and can't find reference > > (e.g. in language tutorial, etc.) to that syntax. I also searched the > > mailing lists and found something in unrelated discussion on dev list > > from which I gathered that it is a valid syntax. Is it something new > > (i.e. newer than 0.24.8)? > > > > Should ssh::auth work on 0.24.8? > > Hi Michael. The reference for this syntax is at > http://reductivelabs.com/trac/puppet/wiki/VirtualResources (linked from > http://reductivelabs.com/trac/puppet/wiki/LanguageTutorial#virtual-resource > s). The docs say that virtual resources are supported since 0.20.0, but > they don't say whether the "collection" syntax ( <|...|> ) is supported > since then-- maybe it's more recent. I'm running 0.25.4, so it's possible > that you need a more recent version of Puppet than 0.24.8 to use > ssh::auth. OK > > If someone can clarify what Puppet version is required for the collection > syntax, I'll add it to the list of requirements of ssh::auth. > > > BTW, I gather the above should be equivalent to: > > > > if $ensure { Ssh_auth_key_client[$title] { ensure => $ensure } } > > > > yes? > > No, that's not correct. To realize a virtual resource, you have to use > either the collection syntax, as in ssh::auth; or the realize function: > > realize Ssh_auth_key_client[$title] > > which, according to the docs, doesn't seem to support adding parameters, > e.g. > > realize Ssh_auth_key_client[$title]{ ensure => $ensure } > > However, in my testing I found that the above does in fact work, but only > if the parameters inside the brackets haven't been set yet. That makes it > not useful for ssh::auth, where the purpose is to override defaults. It's > also undocumented. Even if collection syntax with parameter override also realizes the resource I don't think it matters because in e.g. ssh::auth::client you have: if $ensure { Ssh_auth_key_client <| title = $title |> { ensure => $ensure } } ... realize Ssh_auth_key_client[$title] So even if parameters are overridden first and the resource is realized separately it still works. > > If the collection syntax makes ssh::auth unusable in Puppet 0.24, I'd > gladly change it to something more compatible. But because of the > limitation of the realize function, I can't see a way to do that right now. I did manage to make necessary adjustments to make it work in 0.24.8 but the syntax above turned out to be a smaller issue :) replacing it with the one I suggested above worked. The bigger issue was the =~ operator introduced in 0.25. I did manage to replace it with regsubst but it's ugly (usually one line in 0.25 translates to ~4 in 0.24.8 using regsubst). I can attach the file with my changes if you want to have a look at it, but it's your call if you want to keep compatibility at a price of ... well a bit more convoluted code ;) Did 0.25 ever land in EPEL? I really need to have a look at upgrading sometime. > > Andrew. > -- Michael Gliwinski Henderson Group Information Services 9-11 Hightown Avenue, Newtownabby, BT36 4RT Phone: 028 9034 3319 ** The information in this email is confidential and may be legally privileged. It is intended solely for the addressee and access to the email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients, any opinions or advice contained in this e-mail are subject to the terms and conditions expressed in the governing client engagement leter or contract. If you have received this email in error please notify supp...@henderson-group.com John Henderson (Holdings) Ltd Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, BT36 4RT. Registered in Northern Ireland Registration Number NI010588 Vat No.: 814 6399 12 * -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] Re: Magazine article comparing CPU usage of Puppet vs. Cfengine
On Tuesday 23 Feb 2010 16:22:44 Lindsay Holmwood wrote: > Performance, expressiveness, stability. Pick two. > You make it sound like it's impossible to write a well performing, expressive and stable system in C/C++, etc. Surely you can't think that? I once had an idea of using puppet to also manage configuration on some embedded systems (routers, NAS, heck even tablets like maemo-based), that went quickly out the door once I realised how well performing ruby is. Still I think it would be a valid use case. Regards, Michael -- Michael Gliwinski Henderson Group Information Services 9-11 Hightown Avenue, Newtownabby, BT36 4RT Phone: 028 9034 3319 ** The information in this email is confidential and may be legally privileged. It is intended solely for the addressee and access to the email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients, any opinions or advice contained in this e-mail are subject to the terms and conditions expressed in the governing client engagement leter or contract. If you have received this email in error please notify supp...@henderson-group.com John Henderson (Holdings) Ltd Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, BT36 4RT. Registered in Northern Ireland Registration Number NI010588 Vat No.: 814 6399 12 * -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
[Puppet Users] ssh::auth server dependency on ~/.ssh and a scoping question
Hi Andrew, Just noticed that ssh::auth::server doesn't require the resource for ~/.ssh directory. Considering the documentation says it does (in Examples -> 1. With account management at the bottom mentions that 'require => [User[$title], File["$home/.ssh"]]' is implicitly included in both client and server), I thought I'll report it. This works fine for ssh::auth::server because it uses a file resource for the ~/.ssh/$filename file, so ~/.ssh is autorequired by puppet (if defined). Also, while I'm at it, I wanted to ask a question related to scoping. Don't know if it's another difference between puppet 0.24.8 and 0.25.x, can't find any docs mentioning that. Anyway the problem manifests itself in that simple manifest: import "auth.pp" include ssh::auth Ssh::Auth::Key { length => 4096 } ssh::auth::key { 'foo': } include ssh::auth::keymaster file { '/home/foo/.ssh': ensure => directory, mode => 700, owner => 'foo', group => 'puppet' } ssh::auth::client { 'foo': group => 'foo' } this is a simplified manifest which I ran with standalone puppet and it produces the following error: Only subclasses can override parameters at /root/puppet- tests/sshauth/auth.pp:113 on node ... The problem here is the "group => 'foo'" param passed to ssh::auth::client. It doesn't really matter which parameter it is though as the issue seems to be that the ssh::auth::client (or ssh::auth::server) define cannot override properties of a resource declared in ssh::auth::key define. I searched a bit for something on defines overriding parameters of resources and found a thread here on puppet-users [1] which implies this isn't possible. Does that work in 0.25.x ? [1] http://groups.google.com/group/puppet- users/browse_thread/thread/4836b517cd7b5010 -- Michael Gliwinski Henderson Group Information Services 9-11 Hightown Avenue, Newtownabby, BT36 4RT Phone: 028 9034 3319 ** The information in this email is confidential and may be legally privileged. It is intended solely for the addressee and access to the email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients, any opinions or advice contained in this e-mail are subject to the terms and conditions expressed in the governing client engagement leter or contract. If you have received this email in error please notify supp...@henderson-group.com John Henderson (Holdings) Ltd Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, BT36 4RT. Registered in Northern Ireland Registration Number NI010588 Vat No.: 814 6399 12 * -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] Re: Magazine article comparing CPU usage of Puppet vs. Cfengine
On Wednesday 24 Feb 2010 10:19:57 Nigel Kersten wrote: > > You make it sound like it's impossible to write a well performing, > > expressive and stable system in C/C++, etc. Surely you can't think that? > > I don't think that. > > What I do think is that something like Puppet that needs to abstract > out a bunch of stuff across various platforms is only really going to > work as an open source project with a healthy and active community. > Agreed. > You're much more likely to get such a community form around a high > level language than a lower level one. > That is perhaps relative, but see below. > I wouldn't have contributed as much to Puppet as I've done if it was > written in C/C++. > I see your point, but this is perhaps specific to the domain of configuration management systems? I mean just look at some of the largest free software communities like KDE, which is primarily written in C++ which doesn't seem to be in any way diminishing the number of contributors. -- Michael Gliwinski Henderson Group Information Services 9-11 Hightown Avenue, Newtownabby, BT36 4RT Phone: 028 9034 3319 ** The information in this email is confidential and may be legally privileged. It is intended solely for the addressee and access to the email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients, any opinions or advice contained in this e-mail are subject to the terms and conditions expressed in the governing client engagement leter or contract. If you have received this email in error please notify supp...@henderson-group.com John Henderson (Holdings) Ltd Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, BT36 4RT. Registered in Northern Ireland Registration Number NI010588 Vat No.: 814 6399 12 * -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] ssh::auth server dependency on ~/.ssh and a scoping question
On Wednesday 24 Feb 2010 18:12:18 Andrew Schulman wrote: > > Hi Andrew, > > > > Just noticed that ssh::auth::server doesn't require the resource for > > ~/.ssh directory. Considering the documentation says it does (in > > Examples -> 1. With account management at the bottom mentions that > > 'require => [User[$title], File["$home/.ssh"]]' is implicitly included in > > both client and server), I thought I'll report it. > > > > This works fine for ssh::auth::server because it uses a file resource for > > the ~/.ssh/$filename file, so ~/.ssh is autorequired by puppet (if > > defined). > > OK, thanks for pointing this out. Looking back at it now, I think I was > probably counting on ssh_authorized_key requiring File[$home/.ssh]. But > that doesn't seem to be explicit anywhere, so I'll add it in explicitly for > the next point release. And the user too, while I'm at it. Actually, the user dependency is already there. But now that you mention it, do you think it would be OK to make it optional, e.g. as in `if defined(User[foo]) { ... }`? I actually had to disable it as I don't manage users in puppet (I use nss_ldap and users are in AD). I realize this can lead to failures when user's home directory doesn't exist, but it's not critical, i.e. the key will simply be installed when the directory is created (in case of nss_ldap that is after the first time a user logged on). I haven't found a better way to deal with that yet, if you have better ideas, please share :) > > Also, while I'm at it, I wanted to ask a question related to scoping. > > Don't know if it's another difference between puppet 0.24.8 and 0.25.x, > > can't find any docs mentioning that. Anyway the problem manifests itself > > in that simple manifest: > > > > > > import "auth.pp" > > > > include ssh::auth > > > > Ssh::Auth::Key { length => 4096 } > > > > ssh::auth::key { 'foo': } > > > > include ssh::auth::keymaster > > file { '/home/foo/.ssh': ensure => directory, mode => 700, owner => > > 'foo', group => 'puppet' } > > ssh::auth::client { 'foo': group => 'foo' } > > > > > > this is a simplified manifest which I ran with standalone puppet and it > > produces the following error: > > > > Only subclasses can override parameters at /root/puppet- > > tests/sshauth/auth.pp:113 on node ... > > > > The problem here is the "group => 'foo'" param passed to > > ssh::auth::client. It doesn't really matter which parameter it is though > > as the issue seems to be that the ssh::auth::client (or > > ssh::auth::server) define cannot override properties of a resource > > declared in ssh::auth::key define. > > > > I searched a bit for something on defines overriding parameters of > > resources and found a thread here on puppet-users [1] which implies this > > isn't possible. > > > > Does that work in 0.25.x ? > > I'll have to spend a little time looking into this. The whole purpose of > the way I set up the defines and virtual resources was to be able to > override parameters. The last time I tried it, it worked. I guess it's a > conflict with the file resource in your manifest? I'll see what I can > figure out and get back to you. AFAICS, ssh::auth doesn't declare the '${home}/.ssh' directory and it is the only file resource in the manifest above. Don't know, to be honest scoping and related issues in Puppet DSL have always confused the heck out of me ;) > > Andrew. > Thanks Andrew, let me know if I can help. -- Michael Gliwinski Henderson Group Information Services 9-11 Hightown Avenue, Newtownabby, BT36 4RT Phone: 028 9034 3319 ** The information in this email is confidential and may be legally privileged. It is intended solely for the addressee and access to the email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients, any opinions or advice contained in this e-mail are subject to the terms and conditions expressed in the governing client engagement leter or contract. If you have received this email in error please notify supp...@henderson-group.com John Henderson (Holdings) Ltd Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, BT36 4RT. Registered in Northern Ireland Registration Number NI010588 Vat No.: 814 6399 12 * -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] Re: Correct user management across modules
On Wednesday 24 Feb 2010 16:33:59 atom wrote: > On Feb 24, 6:59 am, Rus Hughes wrote: > > I've got an Apache module and a Nagios module which "require"s the > > Apache module, in the Nagios module we need to add the apache user to > > the nagios group, what would be the best most scalable method to do > > this? Assuming we might have other modules for webapps which need to > > add the apache user to other groups in the future?! > > > > The actual apache user is created by the httpd package (on RedHat) but > > in the Apache module can we just manage the user with something like : > > > > user { "apache": > > uid => 48, > > gid => 48, > > groups => "apache", > > > > } > > > > and then in the Nagios module do > > > > User["apache"]{ groups +> "nagios" } > > > > ? Or is there a better way? > > > > Cheers! > > We do this by defining the service account as a virtual user and > realizing/overriding when necessary. For your example: > > @user { "apache": > uid => 48, > gid => 48, > groups => "apache", > } > > Then in your nagios module: > > Realize(User["apache"]) > User["apache"] { groups +> "nagios" } > > Don't forget to realize it in your apache module too. :) > > -adam > Do you define your virtual users in global scope? I.e. in site.pp or in some module/class? The reason I'm asking is because I had some trouble overriding parameters of resources (even virtual) declared in another class or especially a define. Thanks, Michael -- Michael Gliwinski Henderson Group Information Services 9-11 Hightown Avenue, Newtownabby, BT36 4RT Phone: 028 9034 3319 ** The information in this email is confidential and may be legally privileged. It is intended solely for the addressee and access to the email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients, any opinions or advice contained in this e-mail are subject to the terms and conditions expressed in the governing client engagement leter or contract. If you have received this email in error please notify supp...@henderson-group.com John Henderson (Holdings) Ltd Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, BT36 4RT. Registered in Northern Ireland Registration Number NI010588 Vat No.: 814 6399 12 * -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] 'checkinstall' for custom package creation
On Wednesday 24 Feb 2010 18:30:46 robbyt wrote: > One problem that we frequently run into while building and supporting > puppet infrastructures, is some cowboy developer who insists that he > needs Python 3.1, PHP6, SWiG 1.3.40, etc, and these packages are not > available in our Distro's stable package repository. > > Have you ever tried to build a slotted Python RPM in RHEL? Pardon my > lack of RHCE, but it can be rather time consuming! > > I recently came across a project called "checkinstall" > http://www.asic-linux.com.mx/~izto/checkinstall/ > > Checkinstall acts as a wrapper for `make install`. When you compiled > your copy of php7(or whatever crazy version your developers > require..) : ./configure ; ./make ; ./make check ; checkinstall make > install > > Check install will ask you if you would like to build RPM, Deb, or a > Slackware package (for the 5 remaining Slackware users out there.) You > can also specify some basic dependencies and provides meta-data in > your package. > > I've only used checkinstall for a few small packages, however the tool > could be very useful to some of the lazy puppet admins out there who > need to support crazy versions of various packages via puppet. > I am one such crazy developer ;) and I usually rebuild RPMs from later/latest version of Fedora. However this is not suitable for such packages like python (on which a good part of RHELs plumbing depends) so I just have to suck it up and deal with 2.4 :D I wish RedHat/Fedora/EPEL, etc. dealt with python the same way as Debian does so you could have multiple versions installed alongside, but never really had a chance to take a look at how it's done. Regards, Michael -- Michael Gliwinski Henderson Group Information Services 9-11 Hightown Avenue, Newtownabby, BT36 4RT Phone: 028 9034 3319 ** The information in this email is confidential and may be legally privileged. It is intended solely for the addressee and access to the email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients, any opinions or advice contained in this e-mail are subject to the terms and conditions expressed in the governing client engagement leter or contract. If you have received this email in error please notify supp...@henderson-group.com John Henderson (Holdings) Ltd Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, BT36 4RT. Registered in Northern Ireland Registration Number NI010588 Vat No.: 814 6399 12 * -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] Issue with '|'
On Wednesday 24 Feb 2010 20:59:54 Andrew Hamilton wrote: > I have a question hopefully someone here can help me out with. I have a > module that I didn't write, I got it from the github. it's the postgres > module. I'm running on CentOS 5. In the module there is this: > > case $ensure { > present: { > exec { "Create $name postgres db": > command => "/usr/bin/createdb $ownerstring $name", > user => "postgres", > unless => "/usr/bin/psql -l | grep '$name *|'" *** This > line causes an error > } > } > > The *** line causes puppet to error out like so: > > debug: //Node[myhost.mydomain.com]/Postgres::Role[voiceob]/Exec[Create > puser postgres role]: Executing check '/usr/bin/psql -c '\du' | grep > 'puser *|'' debug: Executing '/usr/bin/psql -c '\du' | grep 'puser *|'' > err: //Node[myhost.mydomain.com]/Postgres::Role[puser]/Exec[Create puser > postgres role]: Failed to retrieve current state of resource: > > (This produces no output if the user doesn't exist in postgres.) > > Nothing more on the error line. Interestingly enough, if I remove the '|' > (pipe) after the psql part of the command, it doesn't error. However, it > doesn't do what I need it to do. I have tried it without the unless line > and it works perfectly. Again, it doesn't do what I need it to do that way > though. I have searched the message boards and wiki to no avail. > > Can any of you shed some light on why this wouldn't work? > > TIA > > Drew > I'm not sure why that doesn't work but I remember some problems I had with psql in postgres setup, I think I eventually started changing the output format to something different, e.g. the above would be: psql -P format=unaligned -tc "\\du ${name} |grep '^ *${name}'" Just an idea, for alternative approach. Regards, Michael -- Michael Gliwinski Henderson Group Information Services 9-11 Hightown Avenue, Newtownabby, BT36 4RT Phone: 028 9034 3319 ** The information in this email is confidential and may be legally privileged. It is intended solely for the addressee and access to the email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients, any opinions or advice contained in this e-mail are subject to the terms and conditions expressed in the governing client engagement leter or contract. If you have received this email in error please notify supp...@henderson-group.com John Henderson (Holdings) Ltd Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, BT36 4RT. Registered in Northern Ireland Registration Number NI010588 Vat No.: 814 6399 12 * -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] Re: Magazine article comparing CPU usage of Puppet vs. Cfengine
On Wednesday 24 Feb 2010 15:56:17 James Turnbull wrote: > On 24/02/10 3:00 AM, Michael Gliwinski wrote: > > I see your point, but this is perhaps specific to the domain of > > configuration management systems? I mean just look at some of the > > largest free software communities like KDE, which is primarily written in > > C++ which doesn't seem to be in any way diminishing the number of > > contributors. > > I suspect it's the domain of sysadmins with problems to solve - who > make a significant portion of Puppet's user base. I have found most > sysadmins cut code in higher level languages - Perl, Python, Ruby > rather than C/C++. > > To get good buy in from them then it's going to be hard if you write > the tool in a lower level language. I look at the pool of cfengine > and Nagios developers versus the pool of users as a (perhaps valid?) > example. > > Regards > > James Turnbull > Yes, that's understandable. I never said it would be good idea for end-users to write extensions in low level language. But again, let me just mention two examples. 1. KDE: itself written in low-level language, provides a very good API and a set of bindings for quite a few higher level dynamic languages (Python, Ruby, JavaScript, and many others); makes the core well performing and easy to extend 2. Bazaar: itself written in high-level language (Python), optimizes the most demanding computations with extensions written in C (with Python-equivalent implementation as a fall-back in case extension wasn't compiled); now that makes use of Python's ability to easily interface with C/C++ modules, don't know how that looks in Ruby's case; anyway, plugins, extensions, even systems that build upon bzrlib are written in high-level language Guess I'm just trying to say that there are options. Mind you, IMO it still makes more sense to make the system more feature-complete first (1.0 release?) and then start thinking about such optimizations. Regards, Michael -- Michael Gliwinski Henderson Group Information Services 9-11 Hightown Avenue, Newtownabby, BT36 4RT Phone: 028 9034 3319 ** The information in this email is confidential and may be legally privileged. It is intended solely for the addressee and access to the email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients, any opinions or advice contained in this e-mail are subject to the terms and conditions expressed in the governing client engagement leter or contract. If you have received this email in error please notify supp...@henderson-group.com John Henderson (Holdings) Ltd Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, BT36 4RT. Registered in Northern Ireland Registration Number NI010588 Vat No.: 814 6399 12 * -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] ssh::auth server dependency on ~/.ssh and a scoping question
On Thursday 25 Feb 2010 15:39:09 Andrew Schulman wrote: > > I also manage users using AD (and likewise-open deployed with puppet), > > and I've had a similar issue. > > I couldn't find an elegant way to deploy ssh public keys "only if" the > > home dir exists. > > > > I do NOT want the user homedir to be created by puppet! (It must be > > created by likewise-open if the user logs in.) > > I also don't want errors to occur if the user folder doesn't exist. So I > > need a "conditional" like: > > > > "IF homedir exists => deploy .ssh/authorized_keys , else do nothing" > > > > As far as I know this is not possible with puppet. > > Marcello, I want to understand your use case. AD and LDAP seem to be > fairly common in Puppet installations, and I'd like for ssh::auth to work > well with them. But I'm not that familiar with them. > > Are you saying that once a user is authorized for a host (or the whole > domain), the user exists on that host, but his/her home directory doesn't, > until they first log in? Yes. > When the user logs in, is his/her home directory automounted from a network > share? In that case, the place to deploy the ssh keys would be in the > user's home directory on the file server. Or, is the home directory > created locally on the host the first time the user logs in? That depends, it is separate from LDAP integration. In basic setup directory is simply created (from /etc/skel IIRC) when the user logs in. > It would seem to me that once a user is authorized for a host, you'd want > to create his/her ~/.ssh/authorized_keys right away, so they can log in by > ssh. If you can explain the sequence of how users get created and > authorized and when their home directories get created, it would help me to > address the need. Yes, it is a bit of a chicken-and-egg problem because the way it works by default means first time the user has to log in using different method than SSH key auth. Don't know, I had no brilliant ideas regarding this yet ;) As it would seem for it to work first time the sshd on a host would need to check/pull user's key from the keymaster. > > Andrew. > Note that as I also mentioned before this means that there are no 'user' type resources in puppet (otherwise puppet would try to create them). -- Michael Gliwinski Henderson Group Information Services 9-11 Hightown Avenue, Newtownabby, BT36 4RT Phone: 028 9034 3319 ** The information in this email is confidential and may be legally privileged. It is intended solely for the addressee and access to the email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients, any opinions or advice contained in this e-mail are subject to the terms and conditions expressed in the governing client engagement leter or contract. If you have received this email in error please notify supp...@henderson-group.com John Henderson (Holdings) Ltd Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, BT36 4RT. Registered in Northern Ireland Registration Number NI010588 Vat No.: 814 6399 12 * -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] Re: Issue with '|'
On Thursday 25 Feb 2010 23:19:33 Andrew Hamilton wrote: > > unlessIf this parameter is set, then this exec will run unless the > > command returns 0 > > I interpret this to be the return value of the command and not the output > of the command. So if the return value of my command is 0 then the > command will not run, yet I can verify that the return value of the > command is 0, yet it still runs. Unless I have this backwards and my > interpretations are incorrect. > Yes, that's right, it's the return value that matters. And since grep returns 0 if match was found and 1 otherwise, this really should work. For reference here's how my exec for creating users looks like (after expanding some parameters): exec { "psql:${name}": command => "psql -c \"CREATE ROLE \\\"${name}\\\"", unless => "psql -P format=unaligned -tc '\\du ${name}' |grep '^ *${name}'", user => 'postgres', path => ['/bin', '/sbin', '/usr/bin', '/usr/sbin', '/usr/local/bin', '/usr/local/sbin'], logoutput => on_failure, require => [Service['postgresql'], User['postgres'], } Basically '-P format=unaligned' makes psql print tuples without spaces used to align their width, it uses the default separator (|) but that can be changed with fieldsep option. And the '-t' option makes it print tuples only (without headers and footer). That should produce exactly one line if the user already exists or none otherwise, the grep is mostly used to get that return value right. If that doesn't work for you, maybe try changing the field separator (i.e. '-P fieldsep=,' or sth) and see if you can work with that. Regards, Michael -- Michael Gliwinski Henderson Group Information Services 9-11 Hightown Avenue, Newtownabby, BT36 4RT Phone: 028 9034 3319 ** The information in this email is confidential and may be legally privileged. It is intended solely for the addressee and access to the email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients, any opinions or advice contained in this e-mail are subject to the terms and conditions expressed in the governing client engagement leter or contract. If you have received this email in error please notify supp...@henderson-group.com John Henderson (Holdings) Ltd Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, BT36 4RT. Registered in Northern Ireland Registration Number NI010588 Vat No.: 814 6399 12 * -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] ssh::auth server dependency on ~/.ssh and a scoping question
On Friday 26 Feb 2010 09:37:28 Alan Barrett wrote: > On Thu, 25 Feb 2010, Marcello de Sousa wrote: > > "IF homedir exists => deploy .ssh/authorized_keys , else do nothing" > > If you don't mind errors when you attempt to apply the manifest and the > homedir does not exist, then you could make the authorized_keys file > depend on something that fails if the homedir does not exist. > > Here's an untested example: > > # If the directory exists, then the "unless" clause in the exec > # is satisfied, so the "command" does not run; but the overall > # exec resource behaves as if it was successful, and anything that > # requires this exec is happy. > # > # If the directory does not exist, then the "unless" fails, so the > # "command" runs; but the command is "/bin/false", so the command > # reports a failure, the overall exec resource fails, and anything > # that requires this exec will have a failed dependency and will > # therefore not be evaluated. > # > exec { "fail if $homedir does not exist": > command => "/bin/false", > unless => "/usr/bin/test -d $homedir", > } > > file { "$homedir/.ssh/authorized_keys": > source => "puppet:///wherever", > require => Exec["fail if $homedir does not exist"], > } > > --apb (Alan Barrett) > That's what I'm doing now. Generally it is sufficient to declare a file resource for ${home}/.ssh and depend on it. It will fail if ${home} doesn't exist. Still, it would be nice to have something better, or at least be able to tell puppet to ignore errors from this resource/scope. -- Michael Gliwinski Henderson Group Information Services 9-11 Hightown Avenue, Newtownabby, BT36 4RT Phone: 028 9034 3319 ** The information in this email is confidential and may be legally privileged. It is intended solely for the addressee and access to the email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients, any opinions or advice contained in this e-mail are subject to the terms and conditions expressed in the governing client engagement leter or contract. If you have received this email in error please notify supp...@henderson-group.com John Henderson (Holdings) Ltd Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, BT36 4RT. Registered in Northern Ireland Registration Number NI010588 Vat No.: 814 6399 12 * -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] ssh::auth server dependency on ~/.ssh and a scoping question
> > Further, I maintain that /etc/ssh/authorized_keys/dtrainor file (my > > key) with a class similar to this: > > > > class sshd::users::dtrainor { > > > > include sshd > > > > file { "/etc/ssh/authorized_keys/dtrainor": > > owner=> 2690, // pulled from LDAP > > group=> root, > > mode=> 0600, > > source=> "puppet:///sshd/authorized_keys/dtrainor", > > require=> Class["sshd::config"] > > } > > > > } > > > > > > Now, I'm no programmer, and I'm certainly not a Puppet expert. But > > I've gotten around the chicken-and-the-egg problem by just being able > > to apply sshd::users::dtrainor to a node that this key should be > > implemented on, and there it is. > > > > Of course I'm open to suggestion and would appreciate some feedback, > > but moreover I hope this gets you pointed in the right direction. > > sshd_config has many options - unfortunately RHEL uses an older sshd > > version that even limits those :) > > > > Thanks > > -dant > > > > > > -- > > You received this message because you are subscribed to the Google > > Groups "Puppet Users" group. > > To post to this group, send email to puppet-us...@googlegroups.com. > > To unsubscribe from this group, send email to puppet- > > users+unsubscr...@googlegroups.com. > > For more options, visit this group at > > http://groups.google.com/group/puppet-users?hl=en. > -- Michael Gliwinski Henderson Group Information Services 9-11 Hightown Avenue, Newtownabby, BT36 4RT Phone: 028 9034 3319 ** The information in this email is confidential and may be legally privileged. It is intended solely for the addressee and access to the email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients, any opinions or advice contained in this e-mail are subject to the terms and conditions expressed in the governing client engagement leter or contract. If you have received this email in error please notify supp...@henderson-group.com John Henderson (Holdings) Ltd Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, BT36 4RT. Registered in Northern Ireland Registration Number NI010588 Vat No.: 814 6399 12 * -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] Re: Issue with '|'
On Friday 26 Feb 2010 16:03:41 Andrew Hamilton wrote: > I can't thank you enough. This worked perfectly for me. I don't know how > it is functionally different than what I had before, but nevertheless this > is exactly what I needed. Thanks again. > > Drew > Heh, yeah, that's the thing, it isn't really functionally different, I'm not sure why what you had before didn't work. Might be something psql specific. Anyway, glad I could help. All the best, Michael -- Michael Gliwinski Henderson Group Information Services 9-11 Hightown Avenue, Newtownabby, BT36 4RT Phone: 028 9034 3319 ** The information in this email is confidential and may be legally privileged. It is intended solely for the addressee and access to the email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients, any opinions or advice contained in this e-mail are subject to the terms and conditions expressed in the governing client engagement leter or contract. If you have received this email in error please notify supp...@henderson-group.com John Henderson (Holdings) Ltd Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, BT36 4RT. Registered in Northern Ireland Registration Number NI010588 Vat No.: 814 6399 12 * -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] Re: Correct user management across modules
On Friday 26 Feb 2010 19:43:22 jcbollinger wrote: > Come to think of it, the issue of using virtual resources is > orthogonal to that of overriding resource properties. You don't need > to make your users virtual to override their parameters, but you do > need to put the override into a subclass of the declaring class. Be > sure to include the subclass in your manifest. It is harmless to > include the base class as well. > Yes, it doesn't matter if they're virtual or not indeed. What you suggested in previous email works very well with classes and that's what I'm using if possible, however there are certain cases where I'm declaring resources in a define. So far I found no way to override parameters of such resources, is there any? -- Michael Gliwinski Henderson Group Information Services 9-11 Hightown Avenue, Newtownabby, BT36 4RT Phone: 028 9034 3319 ** The information in this email is confidential and may be legally privileged. It is intended solely for the addressee and access to the email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients, any opinions or advice contained in this e-mail are subject to the terms and conditions expressed in the governing client engagement leter or contract. If you have received this email in error please notify supp...@henderson-group.com John Henderson (Holdings) Ltd Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, BT36 4RT. Registered in Northern Ireland Registration Number NI010588 Vat No.: 814 6399 12 * -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] If defined() ?
On Thursday 18 Mar 2010 19:04:17 Peter Meier wrote: > > and this: > > > > if ! defined(File["/data/syslog/${remote_host}/archive"]) { > > file { > > "/data/syslog/${remote_host}/archive": > > ensure => directory; > > } > > } > > this should work. > Not in 0.24.x which IIRC is the one Douglas is using. Not 100% sure but this should: if defined(File[...]) != true { ... } or if not then: if defined(File[...]) { notice('using already defined file') } else { file { ... } } -- Michael Gliwinski Henderson Group Information Services 9-11 Hightown Avenue, Newtownabby, BT36 4RT Phone: 028 9034 3319 ** The information in this email is confidential and may be legally privileged. It is intended solely for the addressee and access to the email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients, any opinions or advice contained in this e-mail are subject to the terms and conditions expressed in the governing client engagement leter or contract. If you have received this email in error please notify supp...@henderson-group.com John Henderson (Holdings) Ltd Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, BT36 4RT. Registered in Northern Ireland Registration Number NI010588 Vat No.: 814 6399 12 * -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] sharing variables between definitions
On Wednesday 24 Mar 2010 22:15:27 Michael DeHaan wrote: > On Wed, Mar 24, 2010 at 5:51 PM, Gustavo Soares wrote: > > Hi, Michael! thanks for your reply! > > > > actually it is the opposite.. :) i.e, I want to use the same variable, > > but in different definitions... > > Ok, sorry for the confusion. > > I would have thought "$common_variables::x" would have worked to reference > something in a parent, but it does not. > > Perhaps someone else can share a workaround as I'm not too familiar with > scoping in this case. > > I know you can do variables at top scope or through your external nodes > classifier, but that is not ideal. > > --Michael > IIRC you also need to 'include' the class within the define, then qualified variables (like ${class::variable}) should work. YMMV, these kinds of things have always caused enough issues to drive me crazy, but definitely possible. -- Michael Gliwinski Henderson Group Information Services 9-11 Hightown Avenue, Newtownabby, BT36 4RT Phone: 028 9034 3319 ** The information in this email is confidential and may be legally privileged. It is intended solely for the addressee and access to the email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients, any opinions or advice contained in this e-mail are subject to the terms and conditions expressed in the governing client engagement leter or contract. If you have received this email in error please notify supp...@henderson-group.com John Henderson (Holdings) Ltd Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, BT36 4RT. Registered in Northern Ireland Registration Number NI010588 Vat No.: 814 6399 12 * -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] sharing variables between definitions
On Thursday 25 Mar 2010 11:48:44 Gustavo Soares wrote: > I have thought of using qualified variables, but i think that won't work > inside a tempalte, right? Or can I do <%= class::variable %> ? It will but you have to use <%= scope.lookup('class::variable') %> (note, typing from memory, to be sure check the puppet templating page on the wiki, there is an example there). > And I guess that if I am using dynamic variables, once I include the it > will be evaluated only once, right? I'm not sure what you mean by dynamic variables, but the class is indeed evaluated only once (and therefore variables are bound only once IIUC), even though it is included from a define which may be declared (i.e. 'called'?) multiple times. -- Michael Gliwinski Henderson Group Information Services 9-11 Hightown Avenue, Newtownabby, BT36 4RT Phone: 028 9034 3319 ** The information in this email is confidential and may be legally privileged. It is intended solely for the addressee and access to the email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients, any opinions or advice contained in this e-mail are subject to the terms and conditions expressed in the governing client engagement leter or contract. If you have received this email in error please notify supp...@henderson-group.com John Henderson (Holdings) Ltd Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, BT36 4RT. Registered in Northern Ireland Registration Number NI010588 Vat No.: 814 6399 12 * -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] sharing variables between definitions
Ah, yes, in this case putting it in a class wouldn't work. Well, obviously it wouldn't apply to all variables but in case of paths what I often to is split it, e.g. have $log_root = "/var/log" in the class and in the define do ${class::log_root}/${site}. On Thursday 25 Mar 2010 13:42:13 Gustavo Soares wrote: > Hi, Michael, thank you for your reply. > > What I mean about "dynamic variables" is: > > let's say that I have a variable like *$log_path = "/var/log/$site" *to > specify the log path for different applications > that run on the same host. Thus, depending on the value of $site > variable, the $log_path variable will be different. > > If I put that in a class, it will be evaluated for the first value of $site > called, right? or am I missing something? > > I hope, that I could clarify. :) > > Gus > > On Thu, Mar 25, 2010 at 9:54 AM, Michael Gliwinski < > > michael.gliwin...@henderson-group.com> wrote: > > On Thursday 25 Mar 2010 11:48:44 Gustavo Soares wrote: > > > I have thought of using qualified variables, but i think that won't > > > work inside a tempalte, right? Or can I do <%= class::variable %> ? > > > > It will but you have to use <%= scope.lookup('class::variable') %> (note, > > typing from memory, to be sure check the puppet templating page on the > > wiki, > > there is an example there). > > > > > And I guess that if I am using dynamic variables, once I include the it > > > will be evaluated only once, right? > > > > I'm not sure what you mean by dynamic variables, but the class is indeed > > evaluated only once (and therefore variables are bound only once IIUC), > > even > > though it is included from a define which may be declared (i.e. > > 'called'?) multiple times. > > > > > > -- > > Michael Gliwinski > > Henderson Group Information Services > > 9-11 Hightown Avenue, Newtownabby, BT36 4RT > > Phone: 028 9034 3319 > > > > > > * > >* The information in this email is confidential and > > may be legally privileged. It is intended solely for the addressee and > > access to the email by anyone else is unauthorised. > > If you are not the intended recipient, any disclosure, copying, > > distribution or any action taken or omitted to be taken in reliance on > > it, is prohibited and may be unlawful. > > When addressed to our clients, any opinions or advice contained in this > > e-mail are subject to the terms and conditions expressed in the > > governing client engagement leter or contract. > > If you have received this email in error please notify > > supp...@henderson-group.com > > > > John Henderson (Holdings) Ltd > > Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern > > Ireland, BT36 4RT. > > Registered in Northern Ireland > > Registration Number NI010588 > > Vat No.: 814 6399 12 > > > > ********* > > > > > > -- > > You received this message because you are subscribed to the Google Groups > > "Puppet Users" group. > > To post to this group, send email to puppet-us...@googlegroups.com. > > To unsubscribe from this group, send email to > > puppet-users+unsubscr...@googlegroups.com >legroups.com> . > > For more options, visit this group at > > http://groups.google.com/group/puppet-users?hl=en. > -- Michael Gliwinski Henderson Group Information Services 9-11 Hightown Avenue, Newtownabby, BT36 4RT Phone: 028 9034 3319 -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.