Re: [Puppet Users] Count number of (collected) external resources
Hi Yanis, thanks for the hint. Sounds reasonable - I'll check it out! Bye Frederik On Fri, Sep 26, 2014 at 5:33 AM, Yanis Guenane yguen...@gmail.com wrote: On 09/25/2014 07:11 AM, Frederik Wagner wrote: Hi group, is there a way to count the number of resources of a specific type (with a specific tag) included in the catalog? In more detail: In a manifest I collect external resources like: External::Resource | tag == 'tagged_resource' | Now I would like to know how many resources are actually collected, so I would like to have/write a function $num_res = count_resources( External::Resource, { 'tag' = 'tagged_resource' } ) to be used in the rest of the manifest. Is there a way to realize this in a custom function? I suppose there is, but I'm missing the right API calls. Thanks a lot for any hints in the right direction. Bye Frederik Hi Frederik, I think that puppetdbquery[1] can do what you're looking for. Take a look a it, [1] https://forge.puppetlabs.com/dalen/puppetdbquery -- Yanis Guenane -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/5424DE88.80205%40gmail.com. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CACBNCo%3Dypk%3DTXVUPsf8-NU5WEm9BNFm_u0dX%3DU%3DLrZttmCGQiA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
[Puppet Users] Count number of (collected) external resources
Hi group, is there a way to count the number of resources of a specific type (with a specific tag) included in the catalog? In more detail: In a manifest I collect external resources like: External::Resource | tag == 'tagged_resource' | Now I would like to know how many resources are actually collected, so I would like to have/write a function $num_res = count_resources( External::Resource, { 'tag' = 'tagged_resource' } ) to be used in the rest of the manifest. Is there a way to realize this in a custom function? I suppose there is, but I'm missing the right API calls. Thanks a lot for any hints in the right direction. Bye Frederik -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CACBNCokgkG87ef1m%3D%3DYMgVNZ%2BVLXEcopohG%3DuetVKckd6Ge6cw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] List of properties in provider
Hi Nan, thanks a lot. That works and gave me the right direction, in the end one can use: resource_type.validproperties (or self.class.resource_type.validproperties) Next time I'll check out puppet-dev. Bye Frederik P.S.: BTW nice introductory book ;-) On Wed, Sep 17, 2014 at 6:43 PM, Nan Liu nan@gmail.com wrote: On Wed, Sep 17, 2014 at 6:26 AM, Frederik Wagner fner...@gmail.com wrote: Hi everyone, currently I'm writing a custom provider to configure mailing lists. In the provider I'm writing I need to access the list of all properties (set or unset) defined in the type via 'newproperty'. I'm wondering if there's a way to do that. It feels strange if there wouldn't. What I need to do: Since upon initial creation of a mailing list not all properties can be set, I need to put all defined properties into the @property_hash to have them finally set by the flush method. Therefore I need code like: def exists? ... create mailing list... all_properties_from_type.each { |prop| @property_hash[prop] = @resource[prop] unless @resource[prop].nil? } end Thanks for any help. Bye I don't know what your type is called (replace mailing_list with your type name): Puppet::Type.type(:mailing_list).properties.each { ... } FYI, puppet-dev is probably the better mailing list for these questions since the puppet core dev monitor that and would know if the internal API have been updated recently. Thanks, Nan -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CACqVBqA6SK1eyYCpRByzcuOEFeEWHxtDC2_QHbjG_mYHphkaVw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CACBNCokFM5jj%2B3ojv9s3PvsxOcwyJQ%3DmXEcO%2B3qDe5dqkWcYfQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
[Puppet Users] List of properties in provider
Hi everyone, currently I'm writing a custom provider to configure mailing lists. In the provider I'm writing I need to access the list of all properties (set or unset) defined in the type via 'newproperty'. I'm wondering if there's a way to do that. It feels strange if there wouldn't. What I need to do: Since upon initial creation of a mailing list not all properties can be set, I need to put all defined properties into the @property_hash to have them finally set by the flush method. Therefore I need code like: def exists? ... create mailing list... all_properties_from_type.each { |prop| @property_hash[prop] = @resource[prop] unless @resource[prop].nil? } end Thanks for any help. Bye Frederik -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CACBNComWaMN_oM7Vo8nFMBczxt2LzW5jen__VOqpRr5jrtoFVQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] package resource with pkgutil can not resolv dependencies
Hi Andreas, are you sure that the mirrors for pkgutil are set correctly? (You ar using the 'pkgutil' provider on the cmdline you user 'pkgadd') Does 'pkgutil -a' list the packages? BTW: In stead of the metaparameter 'alias' I would use the 'name' parameter for the package name und 'sudo' as title: package {'sudo': ensure = installed, name = 'CSWsudo', provider = 'pkgutil', } See here http://docs.puppetlabs.com/references/latest/metaparameter.html#alias the 'shortcomings' of alias. Bye Frederik On Thu, May 8, 2014 at 10:28 AM, Andreas Dvorak andreas.dvo...@gmail.com wrote: Dear all I would like to install sudo vom opencsw. I have created one package with all the dependencies. I can install the package on the server without problems, but if I try to install the package with puppet it fails. Can somebody please help me? class: package {'CSWsudo': ensure = installed, provider = 'pkgutil', alias= 'sudo', } Error: Execution of '/opt/csw/bin/pkgutil -y -i CSWsudo' returned 1: Solving needed dependencies ... Warning: CSWcas-migrateconf not in catalog. Warning: CSWcas-preserveconf not in catalog. Warning: CSWlibz1 not in catalog. Warning: CSWiconv not in catalog. Package CSWggettext-data not in catalog. Exiting. All of them are in the CSWsudo package pkgadd -d CSWsudo_sparc_1.8.6p8.pkg The following packages are available: 1 CSWcas-migrateconf cas_migrateconf - Class action script migrateconf (all) 1.47,REV=2012.02.14 2 CSWcas-preserveconf cas_preserveconf - Class action script preserveconf (all) 1.49,REV=2013.03.13 3 CSWcommon common - common files and dirs for CSW packages (sparc) 1.5,REV=2010.12.11 4 CSWggettext-dataggettext_data - GNU locale utilities, translation files (all) 0.18.1.1,p,REV=2011.03.15 5 CSWiconviconv_stub - Transitional package. Content moved to CSWlibcharset1 CSWlibiconv2 (all) 1.14,REV=2011.08.08 6 CSWlibcharset1 libcharset1 - GNU iconv charset library, libcharset.so.1 (sparc) 1.14,REV=2011.08.07 7 CSWlibiconv2libiconv2 - GNU iconv library, libiconv.so.2 (sparc) 1.14,REV=2011.08.07 8 CSWlibintl8 libintl8 - GNU locale utilities, libintl.so.8 (sparc) 0.18.1.1,p,REV=2011.03.15 9 CSWlibz1libz1 - Zlib data compression library, libz.so.1 (sparc) 1.2.7,REV=2012.06.14 10 CSWsudo sudo - Provides limited super user privileges (sparc) 1.8.6p8,REV=2013.04.27 Select package(s) you wish to process (or 'all' to process all packages). (default: all) [?,??,q]: Best regards, Andreas -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/728a1aa8-0b5a-4f63-af34-89f1d7ad4e15%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CACBNCokhicqTsSgSjTXgDbGxJ9yh6D-8Z%3D-Emjk6Z1%3DSCa8CnQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] package resource with pkgutil can not resolv dependencies
Hi Andreras, I'm not an solaris expert, but in your output I don't see the packages: CSWcas-migrateconf CSWcas-preserveconf CSWlibz1 CSWiconv CSWggettext-data So I suppose the pkgutil provider cannot acces them. You proably get an error too, when you run /opt/csw/bin/pkgutil -y -i CSWsudo on the cmdline? This is what puppet tries to do. Bye Frederik On Thu, May 8, 2014 at 12:08 PM, Andreas Dvorak andreas.dvo...@gmail.com wrote: Hi Frederik, /opt/csw/bin/pkgutil -a has the correct output common package catalog size libgcc SMClgcc346 3.4.61.8 MB libiconv SMCliconv1.11 2.2 MB libiconv2CSWlibiconv2 1.14,REV=2011.08.07 2.0 MB libintl SMClintl 3.4.0 319.5 KB libintl8 CSWlibintl8 0.18.1.1,p,REV=2011.03.155.0 MB logrotateCSWlogrotate 3.8.1,REV=2011.09.04 2.3 MB rsyslog CSWrsyslog 5.8.13,REV=2012.09.171.5 MB sed SMCsed 4.2.1 429.1 KB sudo SMCsudo 1.7.4p6518.7 KB zlib_stubCSWzlib 1.2.8,REV=2013.09.2317.8 MB the alias is not used. Best regards Andreas -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/1c15509a-fb8a-460f-bd6c-9d6bbea94081%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CACBNCo%3DJu6YjL8-teO09jdv-41Fz2Mf6aQk8Q%2Bs9CMkA-2B54A%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] package resource with pkgutil can not resolv dependencies
Hi Andreas, the 'pkgutil' provider does not support the 'install_options' Parameter. So it 's not a problem of puppet here but about the underlying pkgutil configuration. The -N option is probably not what you want, since I suppose the dependencies are necessary. Sorry I'm out hier, I don't have deeper knowledge of the pkgutil configuration. Bye Frederik On Thu, May 8, 2014 at 12:49 PM, Andreas Dvorak andreas.dvo...@gmail.com wrote: Hi Frederik, the packages are all in the CSWsudo package. I tried /opt/csw/bin/pkgutil -y -i CSWsudo and it has the same dependency problem. But /opt/csw/bin/pkgutil -N -i CSWsudo does work. So I tried package {'CSWsudo': ensure= installed, provider = 'pkgutil', install_options = '-N', } But again Error: Execution of '/opt/csw/bin/pkgutil -y -i CSWsudo' returned 1: Solving needed dependencies ... Warning: CSWcas-migrateconf not in catalog. Warning: CSWcas-preserveconf not in catalog. Warning: CSWlibz1 not in catalog. Package CSWiconv not in catalog. Exiting. It does not use the -N option. Best regards Andreas -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/1449dd4c-7700-4c42-a87c-dba243186264%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CACBNComS5T9GyjQwNp4%2BKuw%3DKm7-%3DQ7vG--uVYgMkdd7LE2-Ow%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] ANNOUNCE: Puppet 2.7.0 Released
Hi, thanks for the new version, I was looking forward to it since puppetcamp A'dam... Just a minor issue: Installation from the gem gives a rdoc error (on Ubunu/RHEL with ruby 1.8.7): # gem install puppet -v 2.7.0 Successfully installed puppet-2.7.0 1 gem installed Installing ri documentation for puppet-2.7.0... RDoc failure in lib/puppet/interface/option.rb at or around line 6 column 40 Before reporting this, could you check that the file you're documenting compiles cleanly--RDoc is not a full Ruby parser, and gets confused easily if fed invalid programs. The internal error was: ERROR: While generating documentation for puppet-2.7.0 ... MESSAGE: Name or symbol expected (got #RubyToken::TkDSTRING:0x7f734a34b6a0) ... RDOC args: --ri --op /usr/lib/ruby/gems/1.8/doc/puppet-2.7.0/ri --title Puppet - Configuration Management --main README --line-numbers --quiet lib --title puppet-2.7.0 Documentation (continuing with the rest of the installation) Installing RDoc documentation for puppet-2.7.0... RDoc failure in lib/puppet/interface/option.rb at or around line 6 column 40 Before reporting this, could you check that the file you're documenting compiles cleanly--RDoc is not a full Ruby parser, and gets confused easily if fed invalid programs. The internal error was: ERROR: While generating documentation for puppet-2.7.0 ... MESSAGE: Name or symbol expected (got #RubyToken::TkDSTRING:0x7f734a928500) ... RDOC args: --op /usr/lib/ruby/gems/1.8/doc/puppet-2.7.0/rdoc --title Puppet - Configuration Management --main README --line-numbers --quiet lib --title puppet-2.7.0 Documentation (continuing with the rest of the installation) --- Thanks! Frederik On Tue, Jun 21, 2011 at 8:33 PM, Michael Stahnke stah...@puppetlabs.com wrote: It's here! Puppet 2.7.0. This release is available for download at: http://puppetlabs.com/downloads/puppet/puppet-2.7.0.tar.gz It's available as a gem from rubygems.org. See the Verifying Puppet Download section at: http://projects.puppetlabs.com/projects/puppet/wiki/Downloading_Puppet Please report feedback via the Puppet Labs Redmine site, using an affected version of 2.7.0 http://projects.puppetlabs.com/projects/puppet/ Full Release Notes are available: https://projects.puppetlabs.com/projects/puppet/wiki/Release_Notes To see the Full CHANGELOG: https://raw.github.com/puppetlabs/puppet/2.7.0/CHANGELOG Puppet 2.7.0 is out! This is a major feature release, and there's a lot of new stuff. Here's the high-level version: Apache License --- Puppet is now released under the Apache 2.0 license. More info is available [here](http://docs.puppetlabs.com/guides/faq#change-to-apache-license). Ruby 1.9 Support There are some known issues with the 2.7.0 release, but YES: we are now supporting Ruby 1.9.2 and higher, and will be aggressively fixing bugs under Ruby 1.9! Deterministic Catalog Application --- Previously, Puppet didn't guarantee that it would apply unrelated resources in any particular order. This meant that if you forgot to specify some important `before` or `require` relationship, a single catalog might work fine on eight nodes and then fail mysteriously on the ninth and tenth. This could be frustrating! Now it's gone: Puppet will make sure that the same catalog will always be applied in the same order on every machine, and it'll either succeed reliably or fail reliably. (This change will also be appearing in the final 2.6.x releases.) Manage Network Devices Puppet has new types for managing network hardware, and a new `puppet device` subcommand for applying these configurations. These are in their early stages and can currently only handle Cisco hardware, but they're the start of a big leap forward in Puppet's ability to manage your entire infrastructure. Man Pages We've spiffed up our man pages, in both regular and on-the-fly flavors! Try `man puppet-agent` or `puppet man catalog`, and party like it's 1971. (We recommend running `gem install ronn` before using the `puppet man` subcommand.) New Subcommands and the Faces API - We've added a powerful new API for creating new Puppet subcommands, and we've used it to expose most of Puppet's internal subsystems. One of our devs has written a series of blog posts about it ([one][faceswhat], [two][facesmore], [three][facesthree]), and there's more documentation on the way, but this opens the door to whole new ways of running Puppet and exploiting its data. To get a look at the new subcommands, just run `puppet help`; if you're interested in tweaking Puppet under the hood, take a look at `lib/puppet/face/secret_agent.rb` to see how easy it is to re-implement the puppet agent application. We've also implemented a new help interface: just run `puppet help subcommand [action]` for short, to-the-point command-line help with the Faces
[Puppet Users] environment ENC vs cmdline
Hi all, I am using puppet with an ENC script. In this scripts YAML output the environment (generally production) is set. For testing purposes I would like to start puppet runs from the cmdline of a managed host like: $ puppet agent --onetime --no-daemonize --verbose --no-splay --environment development The problem is the --environment Parameter is not being used if an environment is already set in the ENC. The ENC environment settings seems to always win over the cmdline. Is the the desired behavior? I would like to set all configuration (incl. environment) in the ENC, but want to be able to override it from the cmdline. (BTW: switching the environment from the cmdline works, when I remove the line from the ENC.) Thanks and bye, Frederik -- 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] ANNOUNCE: Puppet 2.7.0 Released
Hi Martin, On Wed, Jun 22, 2011 at 4:52 PM, Martin Willemsma mwillem...@gmail.com wrote: My Puppet dashboard shows errors on nodes that want to upgrade from 2.6.7 to 2.7.0. (snip) warning Skipping because of failed dependencies /Stage[main]/Puppet/File[puppet.conf] /etc/puppet/production/modules/puppet/manifests/init.pp 36 2011-06-22 14:55 CEST warning Skipping because of failed dependencies /Stage[main]/Puppet::Centos/Service[puppet] /etc/puppet/production/modules/puppet/manifests/centos.pp 29 2011-06-22 14:55 CEST When I check the local machine the gem was installed, but the service is not restarted so 2.7.0 is not being used. If I get it right, your dependent service is not restarting, since the upgrade resource fails? For me it worked just installing the gem 2.7.0 next to 2.6.8 (through the package provider). How would you have the package provider installing/updateing the puppet gem trigger the puppet service, without killing the just running (daemonized/scheduled) puppet process? It works in two runs: 1. install/upgrade the gem, triggering the service restart (which happens, so the new puppet version is running, but the current run got killed). 2. the next scheduled run, runs normally with the new version. But is there a way not to have the running process killed and produce a failed run? BTW: How do I uninstall the old gem? (there is no ensure = ^2.6.8 or similar) Bye Fredeirk I have a cron job setup that reloads the deamon process once a week, but would like to use 2.7.0 right after upgrade. --- Martin 2011/6/22 Frederik Wagner fner...@googlemail.com Hi, thanks for the new version, I was looking forward to it since puppetcamp A'dam... Just a minor issue: Installation from the gem gives a rdoc error (on Ubunu/RHEL with ruby 1.8.7): # gem install puppet -v 2.7.0 Successfully installed puppet-2.7.0 1 gem installed Installing ri documentation for puppet-2.7.0... RDoc failure in lib/puppet/interface/option.rb at or around line 6 column 40 Before reporting this, could you check that the file you're documenting compiles cleanly--RDoc is not a full Ruby parser, and gets confused easily if fed invalid programs. The internal error was: ERROR: While generating documentation for puppet-2.7.0 ... MESSAGE: Name or symbol expected (got #RubyToken::TkDSTRING:0x7f734a34b6a0) ... RDOC args: --ri --op /usr/lib/ruby/gems/1.8/doc/puppet-2.7.0/ri --title Puppet - Configuration Management --main README --line-numbers --quiet lib --title puppet-2.7.0 Documentation (continuing with the rest of the installation) Installing RDoc documentation for puppet-2.7.0... RDoc failure in lib/puppet/interface/option.rb at or around line 6 column 40 Before reporting this, could you check that the file you're documenting compiles cleanly--RDoc is not a full Ruby parser, and gets confused easily if fed invalid programs. The internal error was: ERROR: While generating documentation for puppet-2.7.0 ... MESSAGE: Name or symbol expected (got #RubyToken::TkDSTRING:0x7f734a928500) ... RDOC args: --op /usr/lib/ruby/gems/1.8/doc/puppet-2.7.0/rdoc --title Puppet - Configuration Management --main README --line-numbers --quiet lib --title puppet-2.7.0 Documentation (continuing with the rest of the installation) --- Thanks! Frederik On Tue, Jun 21, 2011 at 8:33 PM, Michael Stahnke stah...@puppetlabs.com wrote: It's here! Puppet 2.7.0. This release is available for download at: http://puppetlabs.com/downloads/puppet/puppet-2.7.0.tar.gz It's available as a gem from rubygems.org. See the Verifying Puppet Download section at: http://projects.puppetlabs.com/projects/puppet/wiki/Downloading_Puppet Please report feedback via the Puppet Labs Redmine site, using an affected version of 2.7.0 http://projects.puppetlabs.com/projects/puppet/ Full Release Notes are available: https://projects.puppetlabs.com/projects/puppet/wiki/Release_Notes To see the Full CHANGELOG: https://raw.github.com/puppetlabs/puppet/2.7.0/CHANGELOG Puppet 2.7.0 is out! This is a major feature release, and there's a lot of new stuff. Here's the high-level version: Apache License --- Puppet is now released under the Apache 2.0 license. More info is available [here](http://docs.puppetlabs.com/guides/faq#change-to-apache-license). Ruby 1.9 Support There are some known issues with the 2.7.0 release, but YES: we are now supporting Ruby 1.9.2 and higher, and will be aggressively fixing bugs under Ruby 1.9! Deterministic Catalog Application --- Previously, Puppet didn't guarantee that it would apply unrelated resources in any particular order. This meant that if you forgot to specify some important `before` or `require` relationship, a single
Re: [Puppet Users] environment ENC vs cmdline
Hi Nigel, ah yes, thanks. I think I just ran into the problem people were mentioning at puppetcamp... oops. Now I finally get it ;-) Thanks, Frederik On Wed, Jun 22, 2011 at 7:08 PM, Nigel Kersten ni...@puppetlabs.com wrote: On Wed, Jun 22, 2011 at 7:15 AM, Frederik Wagner fner...@googlemail.com wrote: Hi all, I am using puppet with an ENC script. In this scripts YAML output the environment (generally production) is set. For testing purposes I would like to start puppet runs from the cmdline of a managed host like: $ puppet agent --onetime --no-daemonize --verbose --no-splay --environment development The problem is the --environment Parameter is not being used if an environment is already set in the ENC. The ENC environment settings seems to always win over the cmdline. Is the the desired behavior? It is, but there are some complications as this bug shows: http://projects.puppetlabs.com/issues/3910 I would like to set all configuration (incl. environment) in the ENC, but want to be able to override it from the cmdline. (BTW: switching the environment from the cmdline works, when I remove the line from the ENC.) The plan is to allow the client-specified environment to be exposed to the ENC, and then in your ENC you can make the choice between using that, or specifying an environment centrally. -- 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] Virtual Resources
Hi Doug, On Thu, Sep 9, 2010 at 7:06 PM, Douglas Garstang doug.garst...@gmail.com wrote: Would it be safe to say that virtual resources, once defined, sort of become like a globally scoped object within the node? Ie, in one module I can require= an object defined as a virtual resource in another module, as long as they are both being run on the node? The docs really don't make a lot of sense from a practical perspective. this sounds right to me. I am using virutal resources in exactly this way. Bye, Frederik Doug. -- 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. -- 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] parameterized class, external nodes?
On Mon, Aug 30, 2010 at 7:07 AM, Jeff McCune j...@puppetlabs.com wrote: On Fri, Aug 27, 2010 at 2:12 PM, Frederik Wagner fner...@googlemail.com wrote: Alternatively: It seems not to be possible to set the stage metaparameter with a default value in a class definition?! something like this wont run in Stage pre: stage{ pre: before = Stage[main] } class someclass ($stage=pre ) { ... } class { someclass: } Please file this as a bug. http://projects.puppetlabs.com/issues just done Thanks, -Jeff McCune -- 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. -- 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] parameterized class, external nodes?
Hi, On Sat, Jul 31, 2010 at 2:43 AM, Jeff McCune j...@puppetlabs.com wrote: On Fri, Jul 30, 2010 at 5:01 PM, Alan Sparks aspa...@doublesparks.net wrote: How do you (if you can) represent a parameterized class reference in an external node YAML description (exec terminus)? -Alan You can't at the moment, unfortunately. If you have any thoughts about what this API should look like, please describe some of your use cases or how you'd like this interface to operate. It's definitely something that I'm thinking about as well, I just don't think anyone has hammered out a design yet. Is there some progress on this point? I would also need this feature, in particular to use the new staging feature. I would like to include the classes through an external node yaml file. I would also like give the desired stage where the class should be applied. Alternatively: It seems not to be possible to set the stage metaparameter with a default value in a class definition?! something like this wont run in Stage pre: stage{ pre: before = Stage[main] } class someclass ($stage=pre ) { ... } class { someclass: } Thanks and Bye, Frederik -- 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] error from Puppet::Parser::Files.find_template in self defined function
Hi group, today I updated puppet from 0.25.5 to 2.6.0 and I'm running into a problem of a self defined function taken from http://pastie.org/666728. It's the multi_source_template function which takes the first available template from the argument as the one to be processed. This function was running well until version 0.25.5 but now with 2.6.0 I get the error message: err: undefined method `to_sym' for #Puppet::Node::Environment:0x7f9921291140 at /etc/puppet/modules/network-1/manifests/init.pp:66 on node XYZ.mydomain.de This error is triggered by the function call of Puppet::Parser::Files.find_template(file, environment). Can you help me with this problem, since upgrading to 2.6.0 would be very nice :-) Thanks a lot, Frederik -- 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] error from Puppet::Parser::Files.find_template in self defined function
On Fri, Aug 20, 2010 at 4:23 PM, Brice Figureau brice-pup...@daysofwonder.com wrote: On Fri, 2010-08-20 at 16:00 +0200, Frederik Wagner wrote: Hi group, today I updated puppet from 0.25.5 to 2.6.0 and I'm running into a problem of a self defined function taken from http://pastie.org/666728. It's the multi_source_template function which takes the first available template from the argument as the one to be processed. This function was running well until version 0.25.5 but now with 2.6.0 I get the error message: err: undefined method `to_sym' for #Puppet::Node::Environment:0x7f9921291140 at /etc/puppet/modules/network-1/manifests/init.pp:66 on node XYZ.mydomain.de This error is triggered by the function call of Puppet::Parser::Files.find_template(file, environment). Can you help me with this problem, since upgrading to 2.6.0 would be very nice :-) Rewrite Puppet::Parser::Files.find_template(file, environment) to: Puppet::Parser::Files.find_template(file, environment.to_s) thanks so far. The initial error is fine, but now none of the templates are found: ... debug: Looking for Network-1/etc/hosts/service.basenode.erb in production debug: Looking for Network-1/etc/hosts/default.erb in production err: multi_source_template: No match found for files: Network-1/etc/hosts/service.basenode.erb, Network-1/etc/hosts/default.erb at /etc/puppet/modules/network-1/manifests/init.pp:52 on node lx64a147.cos.lrz-muenchen.de err: multi_source_template: No match found for files: Network-1/etc/hosts/service.basenode.erb, Network-1/etc/hosts/default.erb at /etc/puppet/modules/network-1/manifests/init.pp:52 on node lx64a147.cos.lrz-muenchen.de ... the second file Network-1/etc/hosts/default.erb exists Strange... You should better run 2.6.1rc2 than 2.6.0 as some serious bugs have been fixed in this version. o.k., just upgraded... -- Brice Figureau Follow the latest Puppet Community evolutions on www.planetpuppet.org! -- 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. -- 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] Design issue (or: problem with virtual resources)
Hello .*, sorry this is a bit lengthy: I'm in the progress of setting up a puppet system for our Linux cluster (SLES) and have a 'small' design question, since I'm not able to realize my ideas with capabilities of puppet as I have them in mind. At least up to now. The general setup looks like this: There is a central database where all information of the hosts are stored. Next to special hardware layout and network configurations it is stored which type of service a host is offering (e.g. cluster-batchnode, cluter-loginnode, server-nagios, etc.). Connected with this services are the puppet classes which have to be realized on a specific host. This is passed down to puppet by a YAML file with as a list of classes and parameters per host. The classes are organized in modules with a visioning, e.g. ssh-1::client, ssh-1::server, auth-3::ldap etc. In this way (in view of change management), when changing something in the module, I copy the whole module to a new version and (after some testing) just migrate all the affected services to the new module version. So far so good. Now my problem emerges, when a module depends on an other module. This should be version independent (and even better independent of the module name). For example: I have a generic nas-version::virtual module, which provides mountpoint as virtual resources. These can be realized in multiple other modules, without explicitly prepending a Nas-version::Virtual, so I am independent of version and module name. Now the 'but': Typically this virtual resources would depend on other resources (like a mount would depened on a directory to exists). But since requirements are not automatically realizes, this does not work! The virtual file resource for the directory is not automatically realized when realizing the mount. There are multiple solution I thought of: 1. putting everything into a virutal define: but this does not work, since the define is not globally known, so I have to reference it with exlipcit module and version Nas-version::Virtual::Define... 2. changing the 'realize' function to an rvalue and using it in the require parameter to realize the requirement. But this does not work, since the requirements are already realized during 'reading' the definition of the main virtual resource and not just when realizing it! 3. Taking away the version numbering in the module name and giving each module an own module directory (in fileserver.conf like for the files directory with a %h variable) and symlinking the required module version into this per host directory. But this only works for file not for modules, ... So I'm quite lost at this point... The automated realization of required resources would already solve everything here (Issue here: http://projects.puppetlabs.com/issues/3178). But up to now I'm stuck here and some hundreds of nodes want to be puppified... :-) I'm grateful for ideas. There might be a big design flaw as well Thanks a lot in advance for reading so much of my brain dump... Bye, Frederik -- 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] Design issue (or: problem with virtual resources)
Hi Jeff, thanks for your ideas! On Wed, Apr 14, 2010 at 3:12 PM, Jeff McCune mccune.j...@gmail.com wrote: On Wed, Apr 14, 2010 at 8:33 AM, Frederik Wagner fner...@googlemail.com wrote: snip So far so good. Now my problem emerges, when a module depends on an other module. This should be version independent (and even better independent of the module name). For example: I have a generic nas-version::virtual module, which provides mountpoint as virtual resources. These can be realized in multiple other modules, without explicitly prepending a Nas-version::Virtual, so I am independent of version and module name. I don't personally do a whole lot with the realize function, but the way I lay out my modules may help with the version dependency problem you're facing. In modules I write, my init.pp simply includes a manifest named the same as the module. For the ntp module I just have import ntp.pp in init.pp I place all classes in ntp.pp. The first class named ntp is responsible for doing a selection based on facts to determine the specific class for the platform the module is configuring. This looks something like: # modules/ntp/manifests/ntp.pp class ntp { case $operatingsystem { RedHat, CentOS: { include ntp::linux-rh } Solaris: { include ntp::solaris } default: { include ntp::unconfigured } } } class ntp::common { # do stuff } class ntp::linux-rh inherits ntp::common { # override stuff } class ntp::solaris inherits ntp::common { # override stuff } class ntp::unconfigured { # throw warning } # EOF ntp::linux-rh and ntp::solaris both inherit from ntp::common and provide platform specific overrides of the base class. This allows me to simply classify the node as ntp and let the module sort out the platform specifics, or do nothing at all if the platform isn't supported. (I do have the unconfigured classes throw warnings). You should be able to do something similar with specific versions of your modules. Rather than copy your entire module directory, you could have modules/nas/manifest/nas-{1,2,3,4,...}.pp, have init.pp do a import *.pp and then have your node classification point at your specific versioned class, e.g. nas::nas-3 (or some better naming scheme). To achieve your dependency on some consistent non versioned class you could have all of your versioned classes include or descend from another class in the module, say nas::common or nas::nas. This class wouldn't necessarily do anything except provide an anchor to reference in your other modules. Does this make sense? This is purely me thinking out loud while half way through my first cup of coffee, so this may not actually solve the problem but I believe puppet is currently able to provide what you need, although it may be too much of a hack to be a desirable solution. This makes sense. I cold have a 'wrapper' for each module including a versioned class depending on some passed parameter, e.g. I pass through my external node script the version of the nas module $nas_version and define a class like: class nas::mount { include nas::mount-$nas_version } in this way I could get rid of the naming scheme in the main class, but - as far as I tried it - it's not possible to include classes with names composed of variables... Further I'm not yet seeing how I get rid of my virtual resource problem... or wait... I then could use an own class per mountpoint instead of a virtual resource. So using include instead of realize. hmm... Thanks a lot so far. Frederik Hope this helps, -- Jeff McCune -- 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. -- 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] Design issue (or: problem with virtual resources)
On Wed, Apr 14, 2010 at 4:06 PM, Frederik Wagner fner...@googlemail.com wrote: Hi Jeff, thanks for your ideas! On Wed, Apr 14, 2010 at 3:12 PM, Jeff McCune mccune.j...@gmail.com wrote: On Wed, Apr 14, 2010 at 8:33 AM, Frederik Wagner fner...@googlemail.com wrote: snip So far so good. Now my problem emerges, when a module depends on an other module. This should be version independent (and even better independent of the module name). For example: I have a generic nas-version::virtual module, which provides mountpoint as virtual resources. These can be realized in multiple other modules, without explicitly prepending a Nas-version::Virtual, so I am independent of version and module name. I don't personally do a whole lot with the realize function, but the way I lay out my modules may help with the version dependency problem you're facing. In modules I write, my init.pp simply includes a manifest named the same as the module. For the ntp module I just have import ntp.pp in init.pp I place all classes in ntp.pp. The first class named ntp is responsible for doing a selection based on facts to determine the specific class for the platform the module is configuring. This looks something like: # modules/ntp/manifests/ntp.pp class ntp { case $operatingsystem { RedHat, CentOS: { include ntp::linux-rh } Solaris: { include ntp::solaris } default: { include ntp::unconfigured } } } class ntp::common { # do stuff } class ntp::linux-rh inherits ntp::common { # override stuff } class ntp::solaris inherits ntp::common { # override stuff } class ntp::unconfigured { # throw warning } # EOF ntp::linux-rh and ntp::solaris both inherit from ntp::common and provide platform specific overrides of the base class. This allows me to simply classify the node as ntp and let the module sort out the platform specifics, or do nothing at all if the platform isn't supported. (I do have the unconfigured classes throw warnings). You should be able to do something similar with specific versions of your modules. Rather than copy your entire module directory, you could have modules/nas/manifest/nas-{1,2,3,4,...}.pp, have init.pp do a import *.pp and then have your node classification point at your specific versioned class, e.g. nas::nas-3 (or some better naming scheme). To achieve your dependency on some consistent non versioned class you could have all of your versioned classes include or descend from another class in the module, say nas::common or nas::nas. This class wouldn't necessarily do anything except provide an anchor to reference in your other modules. Does this make sense? This is purely me thinking out loud while half way through my first cup of coffee, so this may not actually solve the problem but I believe puppet is currently able to provide what you need, although it may be too much of a hack to be a desirable solution. This makes sense. I cold have a 'wrapper' for each module including a versioned class depending on some passed parameter, e.g. I pass through my external node script the version of the nas module $nas_version and define a class like: class nas::mount { include nas::mount-$nas_version } in this way I could get rid of the naming scheme in the main class, but - as far as I tried it - it's not possible to include classes with names composed of variables... I think I have to correct myself on this part... It seems to work, not as mentioned above but like class nas::mount { $nasmount=nas::mount-${nas_version} include $nasmount } Further I'm not yet seeing how I get rid of my virtual resource problem... or wait... I then could use an own class per mountpoint instead of a virtual resource. So using include instead of realize. hmm... Thanks a lot so far. Frederik Hope this helps, -- Jeff McCune -- 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. -- 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] custom type/provider load error
Hi .*, with the first puppet run on a freshly installed system all custom types and providers a synced. As you can see from the output for some reason puppet tries to load the providers before the types and therefore the custom provider loads throw an error. It looks like the load happens alphabetically ordered, such that providers are loaded before the types... Anyway the puppet run afterwards seems to be fine. Is this a bug or am I doing something wrong? Here the output: info: Retrieving plugin notice: /File[/var/lib/puppet/lib/puppet/provider]/ensure: created notice: /File[/var/lib/puppet/lib/puppet/provider/groupmembers]/ensure: created notice: /File[/var/lib/puppet/lib/puppet/provider/groupmembers/groupadd.rb]/ensure: content changed '{md5}d192f0bcb6642afc939e755acaa284f3' to '{md5}d192f0bcb6642afc939e755acaa284f3' notice: /File[/var/lib/puppet/lib/puppet/provider/package]/ensure: created notice: /File[/var/lib/puppet/lib/puppet/provider/package/zypper.rb]/ensure: content changed '{md5}72e2d43081cf4c87da62e4d285956399' to '{md5}72e2d43081cf4c87da62e4d285956399' notice: /File[/var/lib/puppet/lib/puppet/provider/sysctl]/ensure: created notice: /File[/var/lib/puppet/lib/puppet/provider/sysctl/parsed.rb]/ensure: content changed '{md5}6814a933459673af15383e4445ecdc57' to '{md5}6814a933459673af15383e4445ecdc57' notice: /File[/var/lib/puppet/lib/puppet/type]/ensure: created notice: /File[/var/lib/puppet/lib/puppet/type/append_if_no_such_line.rb]/ensure: content changed '{md5}463a51cc5e538dbe658af9041191949d' to '{md5}463a51cc5e538dbe658af9041191949d' notice: /File[/var/lib/puppet/lib/puppet/type/groupmembers.rb]/ensure: content changed '{md5}f8cf9fb96071078252a35c1807d2' to '{md5}f8cf9fb96071078252a35c1807d2' notice: /File[/var/lib/puppet/lib/puppet/type/sysctl.rb]/ensure: content changed '{md5}975145a3f7c84ec4cc30c622e2acce8d' to '{md5}975145a3f7c84ec4cc30c622e2acce8d' info: Loading downloaded plugin /var/lib/puppet/lib/puppet/provider/groupmembers/groupadd.rb err: Could not load downloaded file /var/lib/puppet/lib/puppet/provider/groupmembers/groupadd.rb: undefined method `provide' for nil:NilClass info: Loading downloaded plugin /var/lib/puppet/lib/puppet/provider/package/zypper.rb info: Loading downloaded plugin /var/lib/puppet/lib/puppet/provider/sysctl/parsed.rb err: Could not load downloaded file /var/lib/puppet/lib/puppet/provider/sysctl/parsed.rb: undefined method `provide' for nil:NilClass info: Loading downloaded plugin /var/lib/puppet/lib/puppet/type/append_if_no_such_line.rb info: Loading downloaded plugin /var/lib/puppet/lib/puppet/type/groupmembers.rb info: Loading downloaded plugin /var/lib/puppet/lib/puppet/type/sysctl.rb Thanks and bye, Frederik -- 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 0.25.* SLES 11 Package
On Wed, Feb 24, 2010 at 3:14 PM, Haris Farooque mfha...@fleetboard.com wrote: Hello members, We are using Puppet-Server 0.24.8 with Factor (1.5.2-1.20) and Puppet 0.24.5 (for client nodes) on our SuSE Machines and its working fine. We are now planning to upgrade to latest stable release 0.25.* for server (with factor) and client-nodes. We just like to enquire you if there is a package/rpm available for SLES 11? If yes, please share with us? Hi, you can use the rpms or at least specs provided here: http://software.opensuse.org/search?baseproject=SUSE%3ASLE-11p=1q=puppet to build your own packages (also for facter, augeas etc.). Works for me. There might be some issue with the shebang in th puppet/puppetmasterd script and the file permissions for the init scripts, as far as I remember (I would need to check) bye Frederik Thanks -- M. Haris Farooque -- 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. -- 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] parsedfile provider documentation?
Hi David, I was just looking a bit more into augeas: Is there a way to set variables in augeas wit values obtained by a 'get' statement? Like: ... augtool get /files/etc/sysconfig/kernel/MODULES_LOADED_ON_BOOT /files/etc/sysconfig/kernel/MODULES_LOADED_ON_BOOT = ipv6 ... Thus having a variable $oldval with values 'ipv6' which I could reuse to set the value again. In this way an appending of values would be easy, e.g.: ... augtool set /files/etc/sysconfig/kernel/MODULES_LOADED_ON_BOOT $oldval sunrpc Thanks and bye, Frederik On Tue, Feb 23, 2010 at 1:42 PM, Frederik Wagner fner...@googlemail.com wrote: Hi David, On Tue, Feb 23, 2010 at 1:09 AM, David Lutterkort lut...@redhat.com wrote: On Mon, 2010-02-22 at 10:45 +0100, Frederik Wagner wrote: MODULES_LOADED_ON_BOOT=module1 module2 My goal ist to have a type, which can append a module3 to this entry, or replace the whole list, etc. (to stay generic for different files in /etc/sysconfig). If you can live with replacing the entire list, you can just use augeas: augeas { my_boot_modules: changes = set /files/etc/sysconfig/kernel/MODULES_LOADED_ON_BOOT '$mymodules' } If you need to build the list up from something else, you might want to wrap the above into a define that computes $mymodules from that something. I would need to append single modules to the list, therefore I was thinking to write the provider. There's also ways to make this just append a specific module, but that would require some work on the Augeas side. does this need new features on the augeas side? Or is it already doable with the current augeas? Anyway a bit more documentation on the ParseFile provider would be nice. Thanks a lot, Fredeirk David -- 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. -- 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] parsedfile provider documentation?
Hi David, On Tue, Feb 23, 2010 at 1:09 AM, David Lutterkort lut...@redhat.com wrote: On Mon, 2010-02-22 at 10:45 +0100, Frederik Wagner wrote: MODULES_LOADED_ON_BOOT=module1 module2 My goal ist to have a type, which can append a module3 to this entry, or replace the whole list, etc. (to stay generic for different files in /etc/sysconfig). If you can live with replacing the entire list, you can just use augeas: augeas { my_boot_modules: changes = set /files/etc/sysconfig/kernel/MODULES_LOADED_ON_BOOT '$mymodules' } If you need to build the list up from something else, you might want to wrap the above into a define that computes $mymodules from that something. I would need to append single modules to the list, therefore I was thinking to write the provider. There's also ways to make this just append a specific module, but that would require some work on the Augeas side. does this need new features on the augeas side? Or is it already doable with the current augeas? Anyway a bit more documentation on the ParseFile provider would be nice. Thanks a lot, Fredeirk David -- 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. -- 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] parsedfile provider documentation?
Hi .*, I'm looking for a more or less thorough documentation of the usage of the parsedfile provider. I'm already scanning through all the existing providers but some open questions remain. In particular I want to write a provider editing the /etc/sysconf/ files, in particular I need to alter the MODULES_LOADED_ON_BOOT in the /etc/sysconfig/kernel (on SLES). The entry looks like: MODULES_LOADED_ON_BOOT=module1 module2 My goal ist to have a type, which can append a module3 to this entry, or replace the whole list, etc. (to stay generic for different files in /etc/sysconfig). I already manage to get the file scanned etc. (using also post_parse, process, to_line) and have the entry manipulated. But for appending I would need to have the resource checked in a custom way (like the 'retrive' method to scan if the module already exists is already in the list). Furthermore I don't understand how to access the parameters in the provider, which are given in the resource definition. This kind of question arise more and more while working on the provider. Therefore a 'complete' documentation would be nice, or a 'complete' example using all the possible hooks. Thanks a lot for some more hints, Frederik -- 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] Iterating Arrays using loop
Hi Haris, On Thu, Feb 18, 2010 at 12:33 PM, Haris Farooque mfha...@fleetboard.com wrote: Dear members, Is it possible to iterate arrays ? Loops will definitely solve this, but i don't know how to do it in puppet. waiting for suggestions and comments unluckily there is no direct loop to do this, puppets array (and hash) handling is rather rudimentary. but you can work on elemts of an array by using a define: if you have an array like: $array=[ entry1, entry2 ] you can use it like: define dosomething { # you will have your array element available here as $name } # use the define with your array dosomething { $array } Hope this helps a bit. But I would like to see a way to hande arrays and hashes a bit more comfotable. Bye Frederik Thanks -- M. Haris -- 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. -- 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] Iterating Arrays using loop
On Thu, Feb 18, 2010 at 1:29 PM, Peter Meier peter.me...@immerda.ch wrote: On 18/02/10 11:14 PM, Frederik Wagner wrote: unluckily there is no direct loop to do this, puppets array (and hash) handling is rather rudimentary. A hash construct will probably be present in the next major release of Puppet: Rowlf. besides that, it might be also worth to think about what you like to do. There have been several threads about this topic in the past on this list and while examining the actual problem one tried to solve, the actual solution was nearly always to solve the problem in a different and better way. generally I agree, but I was thinking a long time to get a way of dealing with a specific problem: I pass (via a YAML configuration) an array parameter with interface/network configurations to a network configuration class. The parameters looks like: $ifcfgs = [ eth0#00:11:22:33:44:55#1234:1234::1/64,10.20.30.40/24##, eth1#00:11:22:33:44:55#11.22.33.44/24##] From this I want to generate the ifcfg-eth0/1 files. Here a loop would be really handy (and hash handling too, to make it more readable). The only solution I found, was to extract the interfaces with the regsubst-function as an array, calling a define where I extract the relevant configuration element from the $ifcfgs via an inline_template (in the end calling another define...). As far as I understand it's still declarative, but very complicated for a simple problem. Bye Frederik Remember puppet is a declarative langauge, which is order independent unless you specify one. It is the intend of the puppet language, well this fits in general for external DSLs, to only have a specific set of instruction to address the domain it was invented for. So far I missed looping only a few times and in general if I re-thought the actual problem I tried to solve, I came up with a cleaner solution without looping. So if you don't see any other solution than loops you could outline your problem and somebody might be able to help you. cheers pete -- 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. -- 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] custom function load
Hi Dan, sorry I have to correct myself. I don't know why I did not have it working before or why I didnt get it, but now it seems to work: As far as I understand _all_ the providers/types/facts/functions in the $modulepath/module/lib/ directories of _all_ modules are loaded, ndepended whether the modules are used or not. Therefore it does work with the module named 'custom', so the name is irrelevant. Only one open question remains: in which order are the $modulepath/module/lib/ directories loaded? If I imagine having identically called files in different modules? Which one will be the winner? Is is load alphanumerically sorted? Thanks anyway and bye, Frederik On Mon, Feb 15, 2010 at 5:48 AM, Dan Bode d...@reductivelabs.com wrote: Hi Frederik, On Fri, Feb 12, 2010 at 4:13 AM, Frederik Wagner fner...@googlemail.com wrote: Hi again, reading the documentation about custom function distribution http://reductivelabs.com/trac/puppet/wiki/PluginsInModules, I don't understand the following: Normally custom per module facts, types, providers and functions are distributed to the puppet hosts when they are in a the modules lib/ directory, like /etc/puppet/modules/modulename/lib/{facter,puppet}. This is also true form custom general facts, types and providers when they are a 'custom'-module directory: /etc/puppet/modules/custom/lib/. But this does not hold for general custom functions! what is this assumption based on? Now my question is: Why are general functions _not_ distributed by this mechanism, when I put hem in /etc/puppet/modules/custom/lib/puppet/parser/functions/, they are distributed, 'custom' here is just the name of the module. but per module functions are? Is there a way to distribute these functions? Thanks and bye, Frederik -- 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. -- 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. -- 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] virtual resource realizing by require?
Hi again, On Thu, Feb 11, 2010 at 11:12 AM, Frederik Wagner fner...@googlemail.com wrote: On Thu, Feb 11, 2010 at 10:42 AM, Alan Barrett a...@cequrux.com wrote: On Tue, 09 Feb 2010, Frederik Wagner wrote: I just tried using the define, and hit a problem which I would avoid (and actually need to avoid) by using the not implemented feature. Realizing the virtual define across modules forces me to give the namespace of the define explicitly, i.e. creating the virtual define @mymount in a class nas-1::virtual (in the Module nas-1) forces me to realize it in a second module as Nas-1::Virtual::Mymount| |, instead of just Mymount| |. Could you put the define in a common module, rather than a NAS-specific module? For example: /* In the util module */ define mymount ($mountpoint) { realize File[$mountpoint] mount { $mountpoint: require = File[$mountpoint], } } /* In the nas-1::virtual class */ @util::mymount { foo: } /* Wherever you want to instantiate the mount: */ include nas-1::virtual realize Util::Mymount[foo] yes, in principle, if it wouldn't be just for this generic Mymount definition. Mymount is somehow just an extended redifinition of mount where all parameters are passed. But besides the required file resource some very nas-1 specific editing in /etc/sysctl.conf etc. (via augeas) should be done. Therefore any Mymount (there are multiple mountspoint on that filer) should also realize an augeas resource which defenitly can not go into the Util module. Do you see what I mean? The nas-1 module would be like: @augeas{ very specifig editing } @file{ mountpoint } @mount{ mountpoint: require = [realize Augeas, realize File] } where - like you said - mount+file have a generic form which can end up in a definition in Util but augeas has to stay in nas-1. As far as I see - and I was thinking quite a while about it - I really end up needing the realization by require feature :-( or it's going to be a intermodule dependency mess. I found a working for this problem! I hope this will work in more complicated situations. I copied the code of the realize-function to be of :type = :rvalue, just additionally returning the resources it realized. In this way I can use it as a input for the 'require' parameter, like @resource_one{ name: ... } @resource_two{ name:... , require = new_realize( Resource_one[name] ) } realize Resource_two[name] This works perfect for this simple case, resource_one is realize automatically and before resource_two. That should be it. I go on testing in a more complicated setup. So wouldn't be a simple idea to just change the realize function (or the '| ... |' operator) to return the resources it realised? Bye, Frederik -- 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] custom function load
Hi again, reading the documentation about custom function distribution http://reductivelabs.com/trac/puppet/wiki/PluginsInModules, I don't understand the following: Normally custom per module facts, types, providers and functions are distributed to the puppet hosts when they are in a the modules lib/ directory, like /etc/puppet/modules/modulename/lib/{facter,puppet}. This is also true form custom general facts, types and providers when they are a 'custom'-module directory: /etc/puppet/modules/custom/lib/. But this does not hold for general custom functions! Now my question is: Why are general functions _not_ distributed by this mechanism, when I put hem in /etc/puppet/modules/custom/lib/puppet/parser/functions/, but per module functions are? Is there a way to distribute these functions? Thanks and bye, Frederik -- 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: virtual resource realizing by require?
Hi John, perfect, thanks! In the meantime I already found the flaw in the before mentioned simple extension of the realize function: The (virtual) requirements of virtual resources are evaluated, even if the resource itself is not realized. E.g. just including the following class test::virtual without realizing resource_two would lead to a realization of resource_one! :-( class test::virtual { @resource_one{ test: ...} @resource_two{ test: ..., require = realize( Resource_one[test] ) } } Now I'm stuck again (and am lost where to start to look for the solution in the sources of puppet ;-). Bye, Frederik On Fri, Feb 12, 2010 at 3:52 PM, jcbollinger john.bollin...@stjude.org wrote: On Feb 12, 8:32 am, jcbollinger john.bollin...@stjude.org wrote: I second this feature request, especially for the | | and | | operators. In fact, I have logged a feature request in redmine, issue 3178. John -- 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. -- 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] virtual resource realizing by require?
On Thu, Feb 11, 2010 at 10:42 AM, Alan Barrett a...@cequrux.com wrote: On Tue, 09 Feb 2010, Frederik Wagner wrote: I just tried using the define, and hit a problem which I would avoid (and actually need to avoid) by using the not implemented feature. Realizing the virtual define across modules forces me to give the namespace of the define explicitly, i.e. creating the virtual define @mymount in a class nas-1::virtual (in the Module nas-1) forces me to realize it in a second module as Nas-1::Virtual::Mymount| |, instead of just Mymount| |. Could you put the define in a common module, rather than a NAS-specific module? For example: /* In the util module */ define mymount ($mountpoint) { realize File[$mountpoint] mount { $mountpoint: require = File[$mountpoint], } } /* In the nas-1::virtual class */ @util::mymount { foo: } /* Wherever you want to instantiate the mount: */ include nas-1::virtual realize Util::Mymount[foo] yes, in principle, if it wouldn't be just for this generic Mymount definition. Mymount is somehow just an extended redifinition of mount where all parameters are passed. But besides the required file resource some very nas-1 specific editing in /etc/sysctl.conf etc. (via augeas) should be done. Therefore any Mymount (there are multiple mountspoint on that filer) should also realize an augeas resource which defenitly can not go into the Util module. Do you see what I mean? The nas-1 module would be like: @augeas{ very specifig editing } @file{ mountpoint } @mount{ mountpoint: require = [realize Augeas, realize File] } where - like you said - mount+file have a generic form which can end up in a definition in Util but augeas has to stay in nas-1. As far as I see - and I was thinking quite a while about it - I really end up needing the realization by require feature :-( or it's going to be a intermodule dependency mess. Thanks a lot, Frederik --apb (Alan Barrett) -- 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. -- 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] virtual resource realizing by require?
Hi Aurelien, On Tue, Feb 9, 2010 at 9:32 AM, Aurelien Degremont aurelien.degrem...@cea.fr wrote: Frederik Wagner a écrit : Hi .*, I'm wondering if there is a way to have a virtual resource realize other virtual resources which it requires. Background: I want to create a module which provides all possible mountpoints from a NAS Filer as virtual resources, like @mount{xyz}. These mounts depend on some directory which must exists, and should only be created if the mount is realized (furthermore some nfs client options are only needed to be set if a nfs mount takes place at all). I would think that something like the following would do the job, but it doesn't. in some class: @file{/mountpoint: ensure = directory } @mount{/mountpoint: ..., require = File[/mountpoint] } in some other class: Mount| title == /mountpoint | What am I missing? Or is this not possible at all? Hello I never really played with virtual ressources but it seems you forgot to also realize the file object for your mountpoint? this is exactly the point of my problem, I would like to automatically realize all resources required by the mount without explicitly stating it in the module realizing the mount. All requirements should be encapsulated in the module providing the @mount. Bye Frederik -- Aurelien Degremont CEA -- 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. -- 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] virtual resource realizing by require?
On Tue, Feb 9, 2010 at 10:55 AM, Aurelien Degremont aurelien.degrem...@cea.fr wrote: Frederik Wagner a écrit : Hi Aurelien, On Tue, Feb 9, 2010 at 9:32 AM, Aurelien Degremont aurelien.degrem...@cea.fr wrote: Frederik Wagner a écrit : Hi .*, I'm wondering if there is a way to have a virtual resource realize other virtual resources which it requires. Background: I want to create a module which provides all possible mountpoints from a NAS Filer as virtual resources, like @mount{xyz}. These mounts depend on some directory which must exists, and should only be created if the mount is realized (furthermore some nfs client options are only needed to be set if a nfs mount takes place at all). I would think that something like the following would do the job, but it doesn't. in some class: @file{/mountpoint: ensure = directory } @mount{/mountpoint: ..., require = File[/mountpoint] } in some other class: Mount| title == /mountpoint | What am I missing? Or is this not possible at all? Hello I never really played with virtual ressources but it seems you forgot to also realize the file object for your mountpoint? this is exactly the point of my problem, I would like to automatically realize all resources required by the mount without explicitly stating it in the module realizing the mount. All requirements should be encapsulated in the module providing the @mount. You need to create your own type with a define define mymount($mountpoint) { file { $mountpoint: ensure = directory } mount { $mountpoint: require = File[$mountpoint], } } @mymount{ /mountpoint: mountpoint = /mountpoint } Mymount| title == /mount_point | Not sure, but i think this is the good way. good idea and I was thining in a similar direction, but in this way all the possible mounts are/must be created in the same way, i.e. in this case a file + a moutn ressource. I was looking for a generic way, let's say somthing like @mount{/mountpoint: ..., require = File| title == /mountpoint] | } which would be great. The requirement is realized only when it is needed. Bye, Frederik -- Aurelien Degremont CEA -- 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. -- 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] virtual resource realizing by require?
On Tue, Feb 9, 2010 at 11:35 AM, Alan Barrett a...@cequrux.com wrote: On Tue, 09 Feb 2010, Frederik Wagner wrote: @file{/mountpoint: ensure = directory } @mount{/mountpoint: ..., require = File[/mountpoint] } in some other class: Mount| title == /mountpoint | I would like to automatically realize all resources required by the mount without explicitly stating it in the module realizing the mount. All requirements should be encapsulated in the module providing the @mount. thanks for the information! There is a feature request for this: http://projects.reductivelabs.com/issues/2084. Until that is implemented, I think you'll need to work around it using a define. very good, i suppose there is no time schedule for this yet? I just tried using the define, and hit a problem which I would avoid (and actually need to avoid) by using the not implemented feature. Realizing the virtual define across modules forces me to give the namespace of the define explicitly, i.e. creating the virtual define @mymount in a class nas-1::virtual (in the Module nas-1) forces me to realize it in a second module as Nas-1::Virtual::Mymount| |, instead of just Mymount| |. But this I have to avoid - and would be avoided by the feature request - since I use a versioning of the modules which should not be part of the realize statement, as well as the modules should not know about each others classnames anyway. Any idea to work around this? Thanks a whole lot! Bye Frederik --apb (Alan Barrett) -- 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. -- 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] virtual resource realizing by require?
Hi .*, I'm wondering if there is a way to have a virtual resource realize other virtual resources which it requires. Background: I want to create a module which provides all possible mountpoints from a NAS Filer as virtual resources, like @mount{xyz}. These mounts depend on some directory which must exists, and should only be created if the mount is realized (furthermore some nfs client options are only needed to be set if a nfs mount takes place at all). I would think that something like the following would do the job, but it doesn't. in some class: @file{/mountpoint: ensure = directory } @mount{/mountpoint: ..., require = File[/mountpoint] } in some other class: Mount| title == /mountpoint | What am I missing? Or is this not possible at all? Thanks a lot, Frederik -- 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.