[Puppet Users] Re: Namespace weirdness
On Sep 16, 2:55 am, Denmat tu2bg...@gmail.com wrote: Hi, Instead of using 'import account' in your init.pp - use 'include' instead. Hmm. That didn't help, but then I found this bug: http://groups.google.com/group/puppet-bugs/browse_thread/thread/889e0e9ded03c27b -- capitalizing names helped; realize ( Users::Account['username'] ) works now. Ilja -- 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: Re: [Puppet Users] cucumber puppet - ymllookups
* tu2bg...@gmail.com [2011-09-15]: # For external lookups $ymllookup_datadir = /etc/puppet/manifests/extdata $ymllookup_precedence = [node/%{fqdn}, location/%{location}, role/%{hitwise_role}, common/common] From the error message I guess that features/yaml/testnode.yaml defines the node's fqdn to something other than 'testnode'. Scenario: testing role Given a node specified by features/yaml/testnode.yaml Given a node of class role This should not work as the yaml specification takes precedence over explicit class. Instead I'd use Given a node of class role And an fqdn of testnode with Given /^an? ([^\]*) of ([^\]*)$/ |fact, value| @facts[fact] = value end HTH, Nikolay -- It's all part of my Can't-Do approach to life. Wally -- 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: Configuration error on 0.25.5 (default provider)
Nicolai, Thanks for the reply. I think I copied the /var/lib/puppet directory from another server as a last resort after trying a bunch of other things first. For the sake of argument, though, I've deleted my entire puppet installation and begun from scratch. I did a yum install of puppet and then did the following: [root@server ~]# puppetd --server puppetmaster.domain.com -- waitforcert 30 --test err: Could not create resources for managing Puppet's files and directories in sections [:main, :puppetd, :ssl]: Could not find a default provider for file err: Could not create resources for managing Puppet's files and directories in sections [:main, :ssl]: Could not find a default provider for file info: Creating a new SSL key for server.domain.com err: Could not request certificate: Cannot save server.domain.com; parent directory /var/lib/puppet/ssl/private_keys does not exist info: Creating a new SSL key for server.domain.com err: Could not request certificate: Cannot save server.domain.com; parent directory /var/lib/puppet/ssl/private_keys does not exist info: Creating a new SSL key for server.domain.com err: Could not request certificate: Cannot save server.domain.com; parent directory /var/lib/puppet/ssl/private_keys does not exist info: Creating a new SSL key for server.domain.com err: Could not request certificate: Cannot save server.domain.com; parent directory /var/lib/puppet/ssl/private_keys does not exist info: Creating a new SSL key for server.domain.com err: Could not request certificate: Cannot save server.domain.com; parent directory /var/lib/puppet/ssl/private_keys does not exist Cancelling startup This error keeps scrolling up the screen until I ctrl-C out of it like I did above. While this is going on, I run `puppetca --sign server.domain.com` on the puppetmaster but it fails and says there is no request from the server. At this point, I create the ssl/ private_keys directory manually. I go through the above steps a few more times and it complains about the ssl/public_keys, ssl/certs and ssl/certificate_requests directories not existing so I create them as well. After all of that, I can finally get a signed ssl cert. Then I try to start the puppet service and get the following errors in syslog: Starting Puppet client version 0.25.5 Could not create resources for managing Puppet's files and directories in sections [:main, :ssl, :puppetd]: Could not find a default provider for file Could not create resources for managing Puppet's files and directories in sections [:main, :ssl]: Could not find a default provider for file Could not retrieve catalog from remote server: No such file or directory - /var/lib/puppet/client_yaml/catalog Using cached catalog Could not retrieve catalog; skipping run At this point, I stop puppet and create the client_yaml/catalog directories. I restart puppet and then get the following errors in syslog which is what my original question was about: Starting Puppet client version 0.25.5 Could not create resources for managing Puppet's files and directories in sections [:main, :ssl, :puppetd]: Could not find a default provider for file Could not create resources for managing Puppet's files and directories in sections [:main, :ssl]: Could not find a default provider for file Could not run Puppet configuration client: Could not find a default provider for file Then puppet does nothing. If you know how to fix this error or you can point out anything in my installation that's wrong, I'd greatly appreciate it. I'm more than happy to read docs, too, if you can point me to good online documentation but I've searched all over the puppet labs site and can't find anything useful. Their docs for installing and configuring a new server are terrible, especially when it comes to adding a new client. Thanks very much for your help. Josh On Sep 15, 7:06 pm, Nicolai nicolai.molle...@gmail.com wrote: There is no need to copy _anything_ from /var/lib/puppet from another machine, actually i think it breaks stuff. As youre running 0.25.5 you need to run puppetd once so that it can create its private key and cert, sign the cert on the master with puppetca --sign machine-name. Then puppet should run and apply the manifests you have for the node. Regards Nicolai -- 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: Ubuntu Execution of '/etc/puppet/etckeeper-commit-pre' returned 1:
I ran into same problem after installing puppet as gem on Ubuntu 10.04. I don't know what's the purpose of '/etc/puppet/etckeeper-commit-pre' but at least such executable is not found in the file system. Workaround for me was to comment out (#) the following lines in /etc/puppet/puppet.conf: prerun_command=/etc/puppet/etckeeper-commit-pre postrun_command=/etc/puppet/etckeeper-commit-post Now puppet runs fine. -- You received this message because you are subscribed to the Google Groups Puppet Users group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/DrjWV4h5jyEJ. 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] define a class on invocation?
I hope I'm overlooking something obvious here. There's a lot of good stuff in puppet that is missing a clue doc ;-) Appreciate a clue-by-four if I overlooked something. I'd like to be able to apply a puppet policy on demand from a node. For example: puppet agent --test --debug --class fixjavainstall The obvious purpose is to test a new class before applying it to many systems. Yes, I can do this: node /test-node/ inherits normal-node-class { fixjavainstall } But this means checking files in and out of SVN, and is a bit heavy for a simple test. I can also copy the class file down to the system and run puppet apply fixjavainstall.pp …but this only tests the class in isolation, not as part of the entire policy. Any better idea for testing new classes or modules within the entire policy run would be appreciated. -- Jo Rhett Net Consonance : consonant endings by net philanthropy, open source and other randomness -- 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] define a class on invocation?
On Sep 15, 2011, at 11:31 PM, Jo Rhett wrote: I hope I'm overlooking something obvious here. There's a lot of good stuff in puppet that is missing a clue doc ;-) Appreciate a clue-by-four if I overlooked something. I'd like to be able to apply a puppet policy on demand from a node. For example: puppet agent --test --debug --class fixjavainstall The obvious purpose is to test a new class before applying it to many systems. Yes, I can do this: node /test-node/ inherits normal-node-class { fixjavainstall } But this means checking files in and out of SVN, and is a bit heavy for a simple test. I can also copy the class file down to the system and run puppet apply fixjavainstall.pp …but this only tests the class in isolation, not as part of the entire policy. Any better idea for testing new classes or modules within the entire policy run would be appreciated. I thought that was the point of environments. Craig -- 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] OpenBSD/i386 Puppet 2.7.3
Trying to start 'puppet master' on new install of Puppet 2.7.3 w/ Facter 1.6.0 OpenBSD 4.8 i386 ruby 1.8.6 (2009-06-08 patchlevel 369) [i386-openbsd4.8] Receiving error: Could not create resources for managing Puppet's files and directories in sections [:main, :ssl]: Could not find a default provider for user With trace: $ sudo puppet master --no-daemonize --verbose --debug --trace debug: Failed to load library 'shadow' for feature 'libshadow' debug: Puppet::Type::User::ProviderUseradd: file chage does not exist debug: Puppet::Type::User::ProviderUser_role_add: file roleadd does not exist debug: Puppet::Type::User::ProviderLdap: true value when expecting false debug: Puppet::Type::User::ProviderPw: file pw does not exist debug: Puppet::Type::User::ProviderDirectoryservice: file /usr/bin/ dscl does not exist /usr/local/lib/ruby/site_ruby/1.8/puppet/type.rb:1402:in `defaultprovider' /usr/local/lib/ruby/site_ruby/1.8/puppet/type.rb:1509:in `default' /usr/local/lib/ruby/site_ruby/1.8/puppet/type.rb:540:in `set_default' /usr/local/lib/ruby/site_ruby/1.8/puppet/type.rb:1762:in `initialize' /usr/local/lib/ruby/site_ruby/1.8/puppet/util/settings.rb:457:in `new' /usr/local/lib/ruby/site_ruby/1.8/puppet/util/settings.rb:457:in `service_user_available?' /usr/local/lib/ruby/site_ruby/1.8/puppet/util/settings/file_setting.rb: 45:in `use_service_user?' /usr/local/lib/ruby/site_ruby/1.8/puppet/util/settings/file_setting.rb: 40:in `owner' /usr/local/lib/ruby/site_ruby/1.8/puppet/util/settings/file_setting.rb: 97:in `to_resource' /usr/local/lib/ruby/site_ruby/1.8/puppet/util/settings.rb:564:in `to_catalog' /usr/local/lib/ruby/site_ruby/1.8/puppet/util/settings.rb:562:in `each' /usr/local/lib/ruby/site_ruby/1.8/puppet/util/settings.rb:562:in `to_catalog' /usr/local/lib/ruby/site_ruby/1.8/puppet/util/settings.rb:621:in `use' /usr/local/lib/ruby/1.8/sync.rb:230:in `synchronize' /usr/local/lib/ruby/site_ruby/1.8/puppet/util/settings.rb:615:in `use' /usr/local/lib/ruby/site_ruby/1.8/puppet/application/master.rb:227:in `setup' /usr/local/lib/ruby/site_ruby/1.8/puppet/application.rb:305:in `run' /usr/local/lib/ruby/site_ruby/1.8/puppet/application.rb:411:in `hook' /usr/local/lib/ruby/site_ruby/1.8/puppet/application.rb:305:in `run' /usr/local/lib/ruby/site_ruby/1.8/puppet/application.rb:402:in `exit_on_fail' /usr/local/lib/ruby/site_ruby/1.8/puppet/application.rb:305:in `run' /usr/local/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:69:in `execute' /usr/local/bin/puppet:4 err: Could not create resources for managing Puppet's files and directories in sections [:main, :master, :ssl, :metr ics]: Could not find a default provider for user debug: Puppet::Type::User::ProviderUseradd: file chage does not exist debug: Puppet::Type::User::ProviderUser_role_add: file roleadd does not exist debug: Puppet::Type::User::ProviderLdap: true value when expecting false debug: Puppet::Type::User::ProviderPw: file pw does not exist debug: Puppet::Type::User::ProviderDirectoryservice: file /usr/bin/ dscl does not exist /usr/local/lib/ruby/site_ruby/1.8/puppet/type.rb:1402:in `defaultprovider' /usr/local/lib/ruby/site_ruby/1.8/puppet/type.rb:1509:in `default' /usr/local/lib/ruby/site_ruby/1.8/puppet/type.rb:540:in `set_default' /usr/local/lib/ruby/site_ruby/1.8/puppet/type.rb:1762:in `initialize' /usr/local/lib/ruby/site_ruby/1.8/puppet/util/settings.rb:457:in `new' /usr/local/lib/ruby/site_ruby/1.8/puppet/util/settings.rb:457:in `service_user_available?' /usr/local/lib/ruby/site_ruby/1.8/puppet/util/settings/file_setting.rb: 45:in `use_service_user?' /usr/local/lib/ruby/site_ruby/1.8/puppet/util/settings/file_setting.rb: 40:in `owner' /usr/local/lib/ruby/site_ruby/1.8/puppet/util/settings/file_setting.rb: 97:in `to_resource' /usr/local/lib/ruby/site_ruby/1.8/puppet/util/settings.rb:564:in `to_catalog' /usr/local/lib/ruby/site_ruby/1.8/puppet/util/settings.rb:562:in `each' /usr/local/lib/ruby/site_ruby/1.8/puppet/util/settings.rb:562:in `to_catalog' /usr/local/lib/ruby/site_ruby/1.8/puppet/util/settings.rb:621:in `use' /usr/local/lib/ruby/1.8/sync.rb:230:in `synchronize' /usr/local/lib/ruby/site_ruby/1.8/puppet/util/settings.rb:615:in `use' /usr/local/lib/ruby/site_ruby/1.8/puppet/application/master.rb:235:in `setup' /usr/local/lib/ruby/site_ruby/1.8/puppet/application.rb:305:in `run' /usr/local/lib/ruby/site_ruby/1.8/puppet/application.rb:411:in `hook' /usr/local/lib/ruby/site_ruby/1.8/puppet/application.rb:305:in `run' /usr/local/lib/ruby/site_ruby/1.8/puppet/application.rb:402:in `exit_on_fail' /usr/local/lib/ruby/site_ruby/1.8/puppet/application.rb:305:in `run' /usr/local/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:69:in `execute' /usr/local/bin/puppet:4 err: Could not create resources for managing Puppet's files and directories in sections [:ca]: Could not find a defa ult provider for userESC[0m debug: Puppet::Type::User::ProviderUseradd: file chage does not exist debug: Puppet::Type::User::ProviderUser_role_add: file roleadd
[Puppet Users] Exported resources not present after master restart
Hi, I was hoping someone has run into the following issues and can help me out. I'm using puppet 0.25.5 and am using exported resources (with expiry) in order to construct configuration for a reverse proxy. There are two issues that I wonder if anyone has run into. Here is a high level of the setup: I have a webserver class that exports a resource that I have defined in order to configuration fragments in files. I have a loadbalancer class that collects these fragments and combines them into a config. The host that is assigned the loadbalancer class is not assigned a webserver class. My first question is whether there is any way to check whether the number of collected resources is greater than zero (a la defined() builtin for reqular variables) so that I don't get the following type of error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find resource type 'Expiringwebserver' on node loadbalancer.blah.blah If no webservers are up this causes the loadbalancer machine to not get updated since it uses it's cached catalog. My second question is that after a restart of the puppet master, if the collecting host connects before any of the exporting hosts, I get the same error as above even if my resources have not expired. Why I think this is strange is that after the first exporting host updates all the exporting hosts resources are visible to the collecting host. Did I miss a bit of configuration that wouldn't require the update from one of the webservers to happen before the loadbalancer updates itself? Would an upgrade fix both these issues? Any help would be greatly appreciated!! -- 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] Re: Ubuntu Execution of '/etc/puppet/etckeeper-commit-pre' returned 1:
That is a package used to store /etc in git. Slightly redundant if you ask me On Sep 16, 2011 7:33 AM, Jussi Heinonen heinonen.ju...@gmail.com wrote: I ran into same problem after installing puppet as gem on Ubuntu 10.04. I don't know what's the purpose of '/etc/puppet/etckeeper-commit-pre' but at least such executable is not found in the file system. Workaround for me was to comment out (#) the following lines in /etc/puppet/puppet.conf: prerun_command=/etc/puppet/etckeeper-commit-pre postrun_command=/etc/puppet/etckeeper-commit-post Now puppet runs fine. -- You received this message because you are subscribed to the Google Groups Puppet Users group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/DrjWV4h5jyEJ. 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. -- 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] custom function puzzlement
This is using puppet 2.6.2 on Debian Squeeze. I am attempting to use a custom function in a module to return random numbers with the hostname (translated to a number) as the random seed. These random numbers can be random values for hour/minute cron, to avoid the herd-of-elephants effect when they all run apt-get update daily. While I'm not experienced with ruby, I've tested the function in a plain ruby script and it seems to work. My /tmp/t1 and /tmp/t2 files on the puppetmaster (see below) have the expected values in them. I have restarted puppetmaster after putting in the function. How do I get the return value out of my function? Am I missing anything else obvious? I am reading from this guide: http://docs.puppetlabs.com/guides/custom_functions.html My cheap-as-heck custom function: $ cat /etc/puppet/modules/yum_apt/lib/puppet/parser/functions/hsrand.rb module Puppet::Parser::Functions newfunction(:hsrand, :type = :rvalue) do |args| values = Hash[ a = 1, b = 2, c = 3, d = 4, e = 5, f = 6, g = 7, h = 8, i = 9, j = 10, k = 11, l = 12, m = 13, n = 14, o = 15, p = 16, q = 17, r = 18, s = 19, t = 20, u = 21, v = 22, w = 23, x = 24, y = 25, z = 26, 1 = 1, 2 = 2, 3 = 3, 4 = 4, 5 = 5, 6 = 6, 7 = 7, 8 = 8, 9 = 9, . = 1, _ = 2, - = 3, ] string = lookupvar('fqdn') File.open('/tmp/t1', 'w') {|f| f.write(string) } stringarray = string.split(//) File.open('/tmp/t2', 'w') {|f| f.write(stringarray[0]) } count = 0 for i in (stringarray) if values[i] count = count + values[i] end end srand(count) rand = rand(args[0]) return(rand) end end In the module's init.pp I attempt to use this in a cron type: $aptupdater = '/usr/bin/apt-get update' # some files and stuff in between cron { 'apt-get-update': command = $aptupdater, user = 'root', hour = hsrand(24), minute = hsrand(60), ensure = present, } However, the cron job on every lab server ends up as: # Puppet Name: apt-get-update 1 1 * * * /usr/bin/apt-get update I greatly appreciate any assistance. I'm stumped. -- 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] define a class on invocation?
On Sep 15, 2011, at 11:31 PM, Jo Rhett wrote: Any better idea for testing new classes or modules within the entire policy run would be appreciated. On Sep 16, 2011, at 8:01 AM, Craig White wrote: I thought that was the point of environments. Would you mind explaining that statement? There simply isn't anything on this page http://docs.puppetlabs.com/guides/environment.html that would indicate such. Yes, I agree that puppet agent --environment dev looks like any easy invocation, but the implementation requires a daemon restart so this doesn't make much sense. In fact, this is a heavy-handed approach that requires about 10x the amount of work compared to creating a node statement for just the node. Any time you have to modify puppet.conf and restart the daemon … very much missing the point for easy testing -- Jo Rhett Net Consonance : consonant endings by net philanthropy, open source and other randomness -- 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] define a class on invocation?
Okay, I figured this out. Yes, you can tweak puppet.conf based on environment (which could be useful for testing new modules) but for my simplified test case below it works something like this: Put this in the class/module: # Client can opt in to this for testing if $environment == 'fixjava' { include fixjavainstall } And then run the client like so: puppet agent --test --environment fixjava On Sep 16, 2011, at 11:21 AM, Jo Rhett wrote: On Sep 15, 2011, at 11:31 PM, Jo Rhett wrote: Any better idea for testing new classes or modules within the entire policy run would be appreciated. On Sep 16, 2011, at 8:01 AM, Craig White wrote: I thought that was the point of environments. Would you mind explaining that statement? There simply isn't anything on this page http://docs.puppetlabs.com/guides/environment.html that would indicate such. Yes, I agree that puppet agent --environment dev looks like any easy invocation, but the implementation requires a daemon restart so this doesn't make much sense. In fact, this is a heavy-handed approach that requires about 10x the amount of work compared to creating a node statement for just the node. Any time you have to modify puppet.conf and restart the daemon … very much missing the point for easy testing -- Jo Rhett Net Consonance : consonant endings by net philanthropy, open source and other randomness -- 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. -- Jo Rhett Net Consonance : consonant endings by net philanthropy, open source and other randomness -- 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] OpenBSD/i386 Puppet 2.7.3
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I expect the default user provider should be useradd(8) but ProviderUseradd seems to be looking for 'chage' binary which isn't used on OpenBSD. I've checked out the 'Puppet OpenBSD' doc but didn't find anything applicable. Searching archives and Google for this error showed a few issues on Solaris and other systems but I wasn't able to find anything specific to this issue. Am I looking at a bug? Likely, I would file a ticket. ~pete -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk5zmxMACgkQbwltcAfKi39jVwCdGIp3gfTsl70/gMaP1ieowEs+ IiIAoJn/ryH+ijPcsOBD546cadZPs/E6 =IOOL -END PGP SIGNATURE- -- 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] Puppet 2.7.3 Cannot alias .. already defined
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I would reference from back from the sysconfig::permissions module to the ntp module file by specifying name = /var/lib/ntp Do I need to change all my modules because I used a feature of puppet which should not be there, and if so, how could I best fix this. does a single manifests like file{'foo': name = '/tmp/foo', mode = 0700; } with puppet apply, also raise an error? ~pete -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk5zm6YACgkQbwltcAfKi3/k2QCfcG/LwcP+pebtbOA1vwFlOLwq BoAAn1ukeUejmGFp4w4yCBk4No34xJhw =pvok -END PGP SIGNATURE- -- 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] ANNOUNCE: Puppet 2.7.4rc3 available
This is a maintenance release candidate of Puppet. This rc addresses issues #9440, #7114, and #8667. This release is available for download at: http://downloads.puppetlabs.com/puppet/ 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.4rc3 http://projects.puppetlabs.com/projects/puppet Documentation is available at: http://docs.puppetlabs.com/index.html RC3 Release Notes === -- Allow cron vars to have leading whitespace Fix #9440 Patch applied from Jeremy Thornhill. This allows whitespace to appear before cron variables. Previously, whitespace before cron variables would trigger a parse failure, and the crontab, except for the puppet managed portion, would get removed. This addresses that issue. It also includes a test for this issue, added into the tests directory, which seems to be where the crontab tests live. -- Write out a list of resources that are managed by puppet agent Feature #8667 Similar to how the Puppet classes are written out each catalog apply, the list of resources is now being written out to a text file that can be easily used by tools like MCollective. This allows tools that do ad-hoc management of resources to know if they're changing a resource that puppet manages, and adjust behavior accordingly. -- Fix value validation on options Fix #7114 Support single options that legally include a comma like from=host1,host2. We now basically allow either word or key=value as options. That's also what the parsedfile provider currently supports when parsing options. -- Changelog * fe92f20 (#9440) Allow cron vars to have leading whitespace * da69637 Fix failing spec for resource file * 7a39ca7 (#8667) Write out a list of resources that are managed by puppet agent * bc40516 Fix order dependent spec failure in exec specs * 3b152e4 (#7114) Fix value validation on options * aa1b36f (#7114) Add tests for option property -- 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] define a class on invocation?
If you use dynamic environments with git as detailed in http://hunnur.com/blog/2010/10/dynamic-git-branch-puppet-environments/ you can get a lot of flexibility without having to hardcode environments. Just branch, commit, push a new remote branch, and then use the environment. On Fri, Sep 16, 2011 at 11:42 AM, Jo Rhett jrh...@netconsonance.com wrote: Okay, I figured this out. Yes, you can tweak puppet.conf based on environment (which could be useful for testing new modules) but for my simplified test case below it works something like this: Put this in the class/module: # Client can opt in to this for testing if $environment == 'fixjava' { include fixjavainstall } And then run the client like so: puppet agent --test --environment fixjava On Sep 16, 2011, at 11:21 AM, Jo Rhett wrote: On Sep 15, 2011, at 11:31 PM, Jo Rhett wrote: Any better idea for testing new classes or modules within the entire policy run would be appreciated. On Sep 16, 2011, at 8:01 AM, Craig White wrote: I thought that was the point of environments. Would you mind explaining that statement? There simply isn't anything on this page http://docs.puppetlabs.com/guides/environment.html that would indicate such. Yes, I agree that puppet agent --environment dev looks like any easy invocation, but the implementation requires a daemon restart so this doesn't make much sense. In fact, this is a heavy-handed approach that requires about 10x the amount of work compared to creating a node statement for just the node. Any time you have to modify puppet.conf and restart the daemon … very much missing the point for easy testing -- Jo Rhett Net Consonance : consonant endings by net philanthropy, open source and other randomness -- 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. -- Jo Rhett Net Consonance : consonant endings by net philanthropy, open source and other randomness -- 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. -- Adrien Thebo adr...@puppetlabs.com -- 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] define a class on invocation?
On Sep 16, 2011 7:27 PM, Adrien Thebo adr...@puppetlabs.com wrote: If you use dynamic environments with git as detailed in http://hunnur.com/blog/2010/10/dynamic-git-branch-puppet-environments/ you can get a lot of flexibility without having to hardcode environments. Just branch, commit, push a new remote branch, and then use the environment. Adrien, Thank you for sharing this link. It's exactly what I've been looking for. -paul -- 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] custom function puzzlement
hello, functions in puppet are always executed on the puppet master. So in your case, every node gets the same value since you're always basing your calculation on the puppet master's fqdn. You might want to look into transforming your function (master-side) into a fact (client-side) or, you could also use the builtin function fqdn_rand, which gives you a random number with the machine's fqdn as a seed for the pseudo-random number generator. It might save you some work: http://docs.puppetlabs.com/references/2.6.8/function.html#fqdnrand On 11-09-16 02:21 PM, Christopher Wood wrote: This is using puppet 2.6.2 on Debian Squeeze. I am attempting to use a custom function in a module to return random numbers with the hostname (translated to a number) as the random seed. These random numbers can be random values for hour/minute cron, to avoid the herd-of-elephants effect when they all run apt-get update daily. While I'm not experienced with ruby, I've tested the function in a plain ruby script and it seems to work. My /tmp/t1 and /tmp/t2 files on the puppetmaster (see below) have the expected values in them. I have restarted puppetmaster after putting in the function. How do I get the return value out of my function? Am I missing anything else obvious? I am reading from this guide: http://docs.puppetlabs.com/guides/custom_functions.html My cheap-as-heck custom function: $ cat /etc/puppet/modules/yum_apt/lib/puppet/parser/functions/hsrand.rb module Puppet::Parser::Functions newfunction(:hsrand, :type = :rvalue) do |args| values = Hash[ a = 1, b = 2, c = 3, d = 4, e = 5, f = 6, g = 7, h = 8, i = 9, j = 10, k = 11, l = 12, m = 13, n = 14, o = 15, p = 16, q = 17, r = 18, s = 19, t = 20, u = 21, v = 22, w = 23, x = 24, y = 25, z = 26, 1 = 1, 2 = 2, 3 = 3, 4 = 4, 5 = 5, 6 = 6, 7 = 7, 8 = 8, 9 = 9, . = 1, _ = 2, - = 3, ] string = lookupvar('fqdn') File.open('/tmp/t1', 'w') {|f| f.write(string) } stringarray = string.split(//) File.open('/tmp/t2', 'w') {|f| f.write(stringarray[0]) } count = 0 for i in (stringarray) if values[i] count = count + values[i] end end srand(count) rand = rand(args[0]) return(rand) end end In the module's init.pp I attempt to use this in a cron type: $aptupdater = '/usr/bin/apt-get update' # some files and stuff in between cron { 'apt-get-update': command = $aptupdater, user = 'root', hour = hsrand(24), minute = hsrand(60), ensure = present, } However, the cron job on every lab server ends up as: # Puppet Name: apt-get-update 1 1 * * * /usr/bin/apt-get update I greatly appreciate any assistance. I'm stumped. -- Gabriel Filion -- 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] OpenBSD/i386 Puppet 2.7.3
dspruell wrote: Could not find a default provider for user I'd say this is a variant of http://projects.puppetlabs.com/issues/4963. A similar fix to the code in that ticket should work. Regards James Turnbull -- James Turnbull Puppet Labs 1-503-734-8571 Join us for PuppetConf http://www.bit.ly/puppetconfsig, September 22nd and 23rd in Portland, Oregon, USA. -- 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] Re: Ubuntu Execution of '/etc/puppet/etckeeper-commit-pre' returned 1:
Ideally folks should bug report this sort of thing against the Ubuntu packages, otherwise they'll never know. On Fri, Sep 16, 2011 at 10:47 AM, Scott Smith sc...@ohlol.net wrote: That is a package used to store /etc in git. Slightly redundant if you ask me On Sep 16, 2011 7:33 AM, Jussi Heinonen heinonen.ju...@gmail.com wrote: I ran into same problem after installing puppet as gem on Ubuntu 10.04. I don't know what's the purpose of '/etc/puppet/etckeeper-commit-pre' but at least such executable is not found in the file system. Workaround for me was to comment out (#) the following lines in /etc/puppet/puppet.conf: prerun_command=/etc/puppet/etckeeper-commit-pre postrun_command=/etc/puppet/etckeeper-commit-post Now puppet runs fine. -- You received this message because you are subscribed to the Google Groups Puppet Users group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/DrjWV4h5jyEJ. 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. -- 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. -- Nigel Kersten Product Manager, Puppet Labs *Join us for **PuppetConf * http://www.bit.ly/puppetconfsig Sept 22/23 Portland, Oregon, USA. * * -- 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] custom function puzzlement
On Fri, Sep 16, 2011 at 09:04:31PM -0400, Gabriel Filion wrote: hello, functions in puppet are always executed on the puppet master. So in your case, every node gets the same value since you're always basing your calculation on the puppet master's fqdn. I certainly appreciate the tip, but I'm fairly sure that the fqdn used is the client's. Every time I kick a client host /tmp/t1 on the puppetmaster changes to the fqdn of that host. As well using my puppetmaster's fqdn as the seed in a separate ruby script gives me a series of random values that doesn't start with 1,1. The Using Facts and Variables section of http://docs.puppetlabs.com/guides/custom_functions.html shows how to use lookupvar() to obtain client facts. You might want to look into transforming your function (master-side) into a fact (client-side) or, you could also use the builtin function fqdn_rand, which gives you a random number with the machine's fqdn as a seed for the pseudo-random number generator. It might save you some work: http://docs.puppetlabs.com/references/2.6.8/function.html#fqdnrand I might if I wanted simple random values, but I'm hoping to branch out eventually. Things like random + 60 or seed on the fqdn if it contains a certain string, otherwise seed on the hostname only. On 11-09-16 02:21 PM, Christopher Wood wrote: This is using puppet 2.6.2 on Debian Squeeze. I am attempting to use a custom function in a module to return random numbers with the hostname (translated to a number) as the random seed. These random numbers can be random values for hour/minute cron, to avoid the herd-of-elephants effect when they all run apt-get update daily. While I'm not experienced with ruby, I've tested the function in a plain ruby script and it seems to work. My /tmp/t1 and /tmp/t2 files on the puppetmaster (see below) have the expected values in them. I have restarted puppetmaster after putting in the function. How do I get the return value out of my function? Am I missing anything else obvious? I am reading from this guide: http://docs.puppetlabs.com/guides/custom_functions.html My cheap-as-heck custom function: $ cat /etc/puppet/modules/yum_apt/lib/puppet/parser/functions/hsrand.rb module Puppet::Parser::Functions newfunction(:hsrand, :type = :rvalue) do |args| values = Hash[ a = 1, b = 2, c = 3, d = 4, e = 5, f = 6, g = 7, h = 8, i = 9, j = 10, k = 11, l = 12, m = 13, n = 14, o = 15, p = 16, q = 17, r = 18, s = 19, t = 20, u = 21, v = 22, w = 23, x = 24, y = 25, z = 26, 1 = 1, 2 = 2, 3 = 3, 4 = 4, 5 = 5, 6 = 6, 7 = 7, 8 = 8, 9 = 9, . = 1, _ = 2, - = 3, ] string = lookupvar('fqdn') File.open('/tmp/t1', 'w') {|f| f.write(string) } stringarray = string.split(//) File.open('/tmp/t2', 'w') {|f| f.write(stringarray[0]) } count = 0 for i in (stringarray) if values[i] count = count + values[i] end end srand(count) rand = rand(args[0]) return(rand) end end In the module's init.pp I attempt to use this in a cron type: $aptupdater = '/usr/bin/apt-get update' # some files and stuff in between cron { 'apt-get-update': command = $aptupdater, user = 'root', hour = hsrand(24), minute = hsrand(60), ensure = present, } However, the cron job on every lab server ends up as: # Puppet Name: apt-get-update 1 1 * * * /usr/bin/apt-get update I greatly appreciate any assistance. I'm stumped. -- Gabriel Filion -- 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] custom function puzzlement
On 11-09-16 09:59 PM, Christopher Wood wrote: Every time I kick a client host /tmp/t1 on the puppetmaster changes to the fqdn of that host. As well using my puppetmaster's fqdn as the seed in a separate ruby script gives me a series of random values that doesn't start with 1,1. The Using Facts and Variables section of http://docs.puppetlabs.com/guides/custom_functions.html shows how to use lookupvar() to obtain client facts. oh, I didn't know about the purpose of lookupvar().. I guess I'll sleep a little less stupid tonight :) sorry for the noise then. -- Gabriel Filion -- 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.