Re: [Puppet Users] Question on accessing a variable from another class
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 modules/rep/templates/test_template.xml.erb ?xml version=1.0? configuration test_template cname='%= ldap_cname % / The template is in a different scope than ldap::variables_common, so ldap_cname is not directly present like that and you need to use: test_template cname='%= scope.lookupvar('ldap::variables_common::ldap_cname') % But for reusable modules etc. I would recommend you to look into hiera [1] and to combine it with parametrized classes as shown in [2], it makes it quite easy and really extensible. ~pete [1] http://www.devco.net/archives/2011/06/05/hiera_a_pluggable_hierarchical_data_store.php [2] http://www.devco.net/archives/2011/06/06/puppet_backend_for_hiera.php -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk5CJC8ACgkQbwltcAfKi3+3lQCdEc5g80XeAE60nBuXlafiy7xE HTcAoLKfAon6XT/e7frTKboQC178hQsq =6jw/ -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] Re: Why?
if you care about order you should make it explicit: Good point, but; exec { 'a': ... } - exec { 'b': ... } - exec { 'c': ... } can I really be sure that puppet evaluates this in the sequence of writing? Rgds, Mats _ On Aug 9, 7:29 pm, vagn scott vagnsc...@gmail.com wrote: On 08/09/2011 01:19 PM, ki_chi_saga wrote: if you care about order you should make it explicit: exec { 'a': ... } - exec { 'b': ... } - exec { 'c': ... } -- 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: Why?
On Aug 9, 8:23 pm, Stefan Schulte stefan.schu...@taunusstein.net wrote: If I understand this, »shareall« will only run if both services are up? Thats is correct. First thing I would do: check what returncode 32 stands for. I've tried but unable to find it. Then run your manifest in debug mode Good point, I will If I recall correctly svcadm enable can actually return before the service is really up. Very interesting. I've also suspecting some kind of timing issue Rgds, Mats -- 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: Why?
On Aug 9, 8:37 pm, Scott Smith sc...@ohlol.net wrote: I suggest using a notice = Exec[shareall] in your dfsshare rather than before. Also make exec{shareall: refreshonly = true} That may or may not help with your problem but either way good design Thanks I will try this Rgds, Mat -- 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: How to subclass a module?
On Aug 10, 12:04 am, Haitao Jiang jianghai...@gmail.com wrote: I put it under modules/xyz/manifests/classes/xyz_new.pp For Puppet auto-loading, the full path to that file should be: modules/xyz/manifests/xyz_new.pp and you won't need any 'import' statements. The problem is that when I include this new class xyz_new, Puppet complained about can not find init err: /Stage[main]/xyz/Service[xyz]: Could not evaluate: Could not find init script for 'xyz' After some experimenting, you need to also override the 'status' parameter, as Puppet needs to check if a service is alive or not to figure out if it has to start and stop. This example will restart Apache if it's down: class foo { service { woof: ensure = running, } } class bar inherits foo { Service[woof] { start = /etc/init.d/httpd start, status = /etc/init.d/httpd status, } } include bar -- 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] list of puppet-agents
Dear all, Is there any why to get the list of the nodes are currently being managed by puppet? I know that I can do that looking in the $vardir/ ssl/ca/signed directory but i was wondering if puppet master itself provides some mechanism. I'm running v2.6.6. Cheers!! -- 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] restarting a specific service
Dear all, How can i restart a service on the agent [only] if the associated configuration file is changed. e.g. if I change the configuration in ntp.conf, I like to restart the ntpd as soon as the changes are detected and applied. Is there a way of doing that? Cheers!! -- 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] restarting a specific service
You need to add a 'subscribe' or 'notify' parameter to your server or file resource (respectively). For example: http://docs.puppetlabs.com/references/stable/metaparameter.html#notify There is an example in the puppetlabs-ntp module: https://github.com/puppetlabs/puppetlabs-ntp/blob/master/manifests/init.pp#L94-109 Or you can just grab the ntp module from the forge and use that instead: http://forge.puppetlabs.com/puppetlabs/ntp ken. On Wed, Aug 10, 2011 at 12:51 PM, Sans r.santanu@gmail.com wrote: Dear all, How can i restart a service on the agent [only] if the associated configuration file is changed. e.g. if I change the configuration in ntp.conf, I like to restart the ntpd as soon as the changes are detected and applied. Is there a way of doing that? Cheers!! -- 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. -- Join us for PuppetConf, September 22nd and 23rd in Portland, OR: http://bit.ly/puppetconfsig; -- 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] list of puppet-agents
On 10/08/11 11:16, Sans wrote: Dear all, Is there any why to get the list of the nodes are currently being managed by puppet? I know that I can do that looking in the $vardir/ ssl/ca/signed directory but i was wondering if puppet master itself provides some mechanism. I'm running v2.6.6. Cheers!! You'll want to set up reporting. This will also tell you when a node has stopped reporting or is otherwise struggling. Have a read through http://docs.puppetlabs.com/guides/reporting.html . You'll also probably want a pretty web frontend like Puppet Dashboard (http://www.puppetlabs.com/puppet/related-projects/dashboard/) or The Foreman (http://theforeman.org/) Dan -- 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] restarting a specific service
Quoting Sans r.santanu@gmail.com: Dear all, How can i restart a service on the agent [only] if the associated configuration file is changed. e.g. if I change the configuration in ntp.conf, I like to restart the ntpd as soon as the changes are detected and applied. Is there a way of doing that? Cheers!! check out subscribe = File['configurationfilename'] in your service stanza or notify = Service['servicename'] in your file stanza, either will work. check the docs for more information. M. -- 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] How should I run/start puppet (v.2.6.x)?
Dear all, Can any one explain this please? [root@puppet puppet]# puppet master --verbose # [root@puppet puppet]# service puppetmaster status puppetmasterd (pid 1876) is running... but the init.d script reports as it's not running: [root@puppet puppet]# /etc/init.d/puppet status puppetd is stopped Is there anything that I'm missing? Cheers!! -- 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: restarting a specific service
Thanks to all for replying; going through the docs. cheers!! -- 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: list of puppet-agents
Thanks Dan, for the link, shall try that, puppet dashboard is seems to be a nice thing; thanks for that as well. Cheers!! -- 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] How should I run/start puppet (v.2.6.x)?
If you want the sysv equivalent to: service puppetmaster status Its: /etc/init.d/puppetmaster status You used the agent's one which is not going to be the same service: [root@puppet puppet]# /etc/init.d/puppet status ken. On Wed, Aug 10, 2011 at 1:52 PM, Sans r.santanu@gmail.com wrote: Dear all, Can any one explain this please? [root@puppet puppet]# puppet master --verbose # [root@puppet puppet]# service puppetmaster status puppetmasterd (pid 1876) is running... but the init.d script reports as it's not running: [root@puppet puppet]# /etc/init.d/puppet status puppetd is stopped Is there anything that I'm missing? Cheers!! -- 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. -- Join us for PuppetConf, September 22nd and 23rd in Portland, OR: http://bit.ly/puppetconfsig; -- 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: Pluginsync hangs indefinitely
I do not think your problem is related to autosign, but surely that would be easy enough to test. More below. On Aug 9, 6:11 pm, Nathaniel Cook nvcoo...@gmail.com wrote: I have run the code by hand and it works just fine. Here it is: # require 'facter' def addFact(name , cmd) matches = cmd.scan(/\$\{\w+\}/) if ! matches.empty? for i in 0...matches.length match = matches[i] match = match[2..-2] value = Facter[match].value() if value == nil value = '' end cmd = cmd.gsub(/\$\{#{Regexp.escape(match)}\}/, value) end end Facter.add(name) do setcode do `#{cmd}`.chomp end end end # # List of facts to define, # # Can have references to previous facts by using the ${var} syntax # facts = { 'ec2_region' = 'cat /opt/aws/info/region', 'ec2_instance_id' = 'cat /opt/aws/info/instance-id', 'ec2_url' = 'echo https://ec2.${ec2_region}.amazonaws.com;', 'ec2_zone' = ec2-metadata -z | awk {'print $NF'} } if ! Facter['ec2_ami_id'] puts Not loading aws_facts else keys = facts.keys for key in 0...keys.length fact = keys[key] addFact(fact, facts[fact]) end end ## Its a simple script that sets up some facts about aws ec2 instances. Hope this helps. I am not convinced that your fact code is in the clear, despite your success running it outside a Puppet context. Indeed there's a lot in it that I find suspicious, questionable, and / or unsafe, even if it turns out not to be responsible for your hang problem: 1) You use a lot of variables with rather generic names, in scopes where they conceivably could collide with variables belonging to Facter proper or to Puppet. 2) I think your setup for interpolating fact values into other fact values is too clever by half. I recommend you reserve interpolation for Puppet itself to perform. In particular, the ec2_url fact provides nothing whatever that wouldn't more appropriately be done by Puppet. 3) If you do retain Facter-side interpolation, then you probably need to do it in the fact code itself (i.e. inside the setcode block), as I would not expect it to be safe to assume that *any* fact values were available at the time that your addFact() funciton is executed. 4) If you do retain Facter-side interpolation, then you should also take the evaluation order of facts into consideration. I do not think it safe to assume that that order will be the same as the order in which your facts are added, and it certainly is not safe to assume that your facts will be added in the order they are listed in your hash. If you get lucky, then it might end up working for you -- perhaps even reliably -- but I could easily imagine that changing with addition of more custom facts or with a Facter upgrade. For me, this would be a show-stopper. 5) The reasoning in (4) also suggests that it may not be safe to use facts within Facter to determine whether to add other facts (which you do). Even if it happens to work now, I would never rely on such behavior without solid API documentation supporting it. (Is there any?) Here's how I would write the facts you showed: Facter.add('ec2_region') do setcode do `cat /opt/aws/info/region || echo`.chomp end end Facter.add('ec2_instance_id') do setcode do `cat /opt/aws/info/instance-id || echo`.chomp end end # ec2_url intentionally omitted Facter.add('ec2_zone') do setcode do # Note: you should consider using an explicit path # to some or all of the system commands below: `ec2-metadata -z | awk {'print $NF'} || echo`.chomp end end It's short, sweet, easy to read, and easy to maintain. It also has no risk of variable collisions, no evaluation-order dependencies, and it works on all nodes, regardless of whether they are ec2. So, does Puppet still hang if you remove the custom facts? (You'll need to both disable pluginsync and manually remove the custom fact code from the client, or else make the client sync up a no-op version.) If not, then does it hang with my version of them? This should give you a good start on debugging. 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-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: Why?
On 08/10/2011 02:40 AM, ki_chi_saga wrote: exec { 'a': ... } - exec { 'b': ... } - exec { 'c': ... } can I really be sure that puppet evaluates this in the sequence of writing? See the little arrows? - That is one way to declare sequence. There are others. See the puppet language guide. -- vagn -- 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: Pluginsync hangs indefinitely
Thanks John that did it, your script worked great. Now that I think about it I see how using facts to generate more facts could cause these issues. Nathaniel On Aug 10, 8:16 am, jcbollinger john.bollin...@stjude.org wrote: I do not think your problem is related to autosign, but surely that would be easy enough to test. More below. On Aug 9, 6:11 pm, Nathaniel Cook nvcoo...@gmail.com wrote: I have run the code by hand and it works just fine. Here it is: # require 'facter' def addFact(name , cmd) matches = cmd.scan(/\$\{\w+\}/) if ! matches.empty? for i in 0...matches.length match = matches[i] match = match[2..-2] value = Facter[match].value() if value == nil value = '' end cmd = cmd.gsub(/\$\{#{Regexp.escape(match)}\}/, value) end end Facter.add(name) do setcode do `#{cmd}`.chomp end end end # # List of facts to define, # # Can have references to previous facts by using the ${var} syntax # facts = { 'ec2_region' = 'cat /opt/aws/info/region', 'ec2_instance_id' = 'cat /opt/aws/info/instance-id', 'ec2_url' = 'echo https://ec2.${ec2_region}.amazonaws.com;', 'ec2_zone' = ec2-metadata -z | awk {'print $NF'} } if ! Facter['ec2_ami_id'] puts Not loading aws_facts else keys = facts.keys for key in 0...keys.length fact = keys[key] addFact(fact, facts[fact]) end end ## Its a simple script that sets up some facts about aws ec2 instances. Hope this helps. I am not convinced that your fact code is in the clear, despite your success running it outside a Puppet context. Indeed there's a lot in it that I find suspicious, questionable, and / or unsafe, even if it turns out not to be responsible for your hang problem: 1) You use a lot of variables with rather generic names, in scopes where they conceivably could collide with variables belonging to Facter proper or to Puppet. 2) I think your setup for interpolating fact values into other fact values is too clever by half. I recommend you reserve interpolation for Puppet itself to perform. In particular, the ec2_url fact provides nothing whatever that wouldn't more appropriately be done by Puppet. 3) If you do retain Facter-side interpolation, then you probably need to do it in the fact code itself (i.e. inside the setcode block), as I would not expect it to be safe to assume that *any* fact values were available at the time that your addFact() funciton is executed. 4) If you do retain Facter-side interpolation, then you should also take the evaluation order of facts into consideration. I do not think it safe to assume that that order will be the same as the order in which your facts are added, and it certainly is not safe to assume that your facts will be added in the order they are listed in your hash. If you get lucky, then it might end up working for you -- perhaps even reliably -- but I could easily imagine that changing with addition of more custom facts or with a Facter upgrade. For me, this would be a show-stopper. 5) The reasoning in (4) also suggests that it may not be safe to use facts within Facter to determine whether to add other facts (which you do). Even if it happens to work now, I would never rely on such behavior without solid API documentation supporting it. (Is there any?) Here's how I would write the facts you showed: Facter.add('ec2_region') do setcode do `cat /opt/aws/info/region || echo`.chomp end end Facter.add('ec2_instance_id') do setcode do `cat /opt/aws/info/instance-id || echo`.chomp end end # ec2_url intentionally omitted Facter.add('ec2_zone') do setcode do # Note: you should consider using an explicit path # to some or all of the system commands below: `ec2-metadata -z | awk {'print $NF'} || echo`.chomp end end It's short, sweet, easy to read, and easy to maintain. It also has no risk of variable collisions, no evaluation-order dependencies, and it works on all nodes, regardless of whether they are ec2. So, does Puppet still hang if you remove the custom facts? (You'll need to both disable pluginsync and manually remove the custom fact code from the client, or else make the client sync up a no-op version.) If not, then does it hang with my version of them? This should give you a good start on debugging. John -- You received this message because you are subscribed to the Google Groups Puppet Users
[Puppet Users] Re: RHEL 5.x remount an invalid option to NFS?
On Aug 9, 3:18 pm, Forrie for...@gmail.com wrote: I made an adjustment to my puppet config for three systems today, which has the remount option set to true in the *.pp, and I see this in the logs on my systems: Execution of '/bin/mount -o remount /home/directory' returned 32: mount.nfs: Invalid argument remount is valid to the mount command, but not to the mount.nfs command on RHEL. I'm not really sure if this is important or how to get around this -- or if this is a bug. The 'remount' option is valid for all filesystem types. mount.nfs is complaining about the mount point argument -- this happens when an attempt is made to remount a file system that is listed in /etc/fstab but is not already mounted. I'd account it a Puppet bug. It appears related to http://projects.puppetlabs.com/issues/6027 and http://projects.puppetlabs.com/issues/6309, yet distinct from them. I suggest you file a ticket. Unless you're interested in creating a local version of Puppet, the only general workaround I can see is to set remounts = false on your Mount resource. There may be something special about your manifests that triggers this bug, however, in which case there may be other workarounds available. If you do plan to file a ticket, then the requisite process of narrowing down the failure case should reveal any such special circumstances that may be contributing. 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-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] Sarasota meet up?
Hi all, I find myself in (generally) sunny Sarasota Florida for a few weeks. Any folks in the area want to meet up for drinks and puppet chatter? -- ToddOpenPGP - KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp ~~ Subtlety is the art of saying what you think and getting out of the way before it is understood. -- Anonymous pgpeqyFQ48cbv.pgp Description: PGP signature
[Puppet Users] generate function
Seems I don't quite understand how it's supposed to work At the moment, I have it inside a 'file' resource content = generate(/etc/puppet/scripts/ldap-add-host.sh $fqdn admins_all), Thus I want to execute the command /etc/puppet/scripts/ldap-add-host.sh and pass parameters $1 = $fqdn $2 = admins_all (though there will be other groups to pass in the future) the error it gives me is... Could not retrieve catalog from remote server: Error 400 on SERVER: Generators can only contain alphanumerics, file separators, and dashes at /etc/puppet/modules/ldap/manifests/configure.pp:93 on node ubuntu.ttinet documentation on the generate function is sort of sparse and I am not able to deduce the structure of an acceptable command but I gather that spaces are not allowed. How do I structure this? -- Craig White ~~ craig.wh...@ttiltd.com 1.800.869.6908 ~~~ www.ttiassessments.com Need help communicating between generations at work to achieve your desired success? Let us help! -- 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] generate function
On Wed, Aug 10, 2011 at 16:40, Craig White craig.wh...@ttiltd.com wrote: Seems I don't quite understand how it's supposed to work At the moment, I have it inside a 'file' resource content = generate(/etc/puppet/scripts/ldap-add-host.sh $fqdn admins_all), generate(/etc/puppet/scripts/ldap-add-hosh.sh, $fqdn, admins_all) Daniel -- ⎋ Puppet Labs Developer – http://puppetlabs.com ♲ Made with 100 percent post-consumer electrons -- 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] generate function
On Aug 10, 2011, at 9:52 AM, Daniel Pittman wrote: On Wed, Aug 10, 2011 at 16:40, Craig White craig.wh...@ttiltd.com wrote: Seems I don't quite understand how it's supposed to work At the moment, I have it inside a 'file' resource content = generate(/etc/puppet/scripts/ldap-add-host.sh $fqdn admins_all), generate(/etc/puppet/scripts/ldap-add-hosh.sh, $fqdn, admins_all) that worked great but brings me to a place I can't figure out. A file resource doesn't have 'unless' or 'onlyif' and thus it seems to execute every time. An exec resource doesn't have 'content' but does have command and 'unless' so it would seem exec would be a better way to go but... # Puppet maintained file /etc/puppet/deployment_files/ldap_admins_all exec{/etc/puppet/deployment_files/ldap_admins_all: command = ['/bin/touch /etc/puppet/deployment_files/admins_all', generate(/etc/puppet/scripts/ldap-add-host.sh, $fqdn, admins_all)], unless = /bin/ls -l /etc/puppet/deployment_files/ldap_admins_all, require = Class[mod_puppet::deployment_files], } gives me the error... err: Failed to apply catalog: private method `split' called for #Array:0x4873be8 and I could pass an array to 'file' resource using content but not 'exec' resource using command ;-( 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] Strange Could not find dependency error
Hi, I have the following: class nagios { include nagios::params file { [ ${nagios::params::nagios_confdir}, ${nagios::params::nagios_confdir}/app_alerts, ${nagios::params::nagios_confdir}/app_alerts/ssa, ${nagios::params::nagios_confdir}/app_alerts/ssa/ services ]: ensure = directory, owner = 'root', group = 'root', mode = 755, } define couchdb_check () { $couchdb_bind_address = localhost $couchdb_port = 5984 $couchdb_baseurl = http://${couchdb_bind_address}:$ {couchdb_port} $couchdb_url = ${couchdb_baseurl}/nagios_alerts/${name} nagios_service { ssa_${name}: target = ${nagios::params::nagios_confdir}/app_alerts/ssa/ services/${name}.cfg, use = pnp4nagios-service, service_description = couchdblookup($couchdb_url, desc), require = File[${nagios::params::nagios_confdir}/app_alerts/ ssa/services] } } } class ssa::nagios { include nagios nagios::couchdb_check { [check1, check2 ]: } } So there is ssa::nagios that includes nagios class but I get error err: Could not run Puppet configuration client: Could not find dependency File[/etc/nagios/conf.d/app_alerts/ssa/services] for Nagios_service[check1] at /etc/puppet/modules/nagios/manifests/init.pp: 32 Changed include nagios to require nagios - same error. Of course nagios::params::nagios_confdir=/etc/nagios/conf.d And nagios class is supposed to be evaluated before ssa::nagios - so how come it does not find the File dependency declared in the nagios class? Thanks Alex -- 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] generate function
On Wed, Aug 10, 2011 at 17:56, Craig White craig.wh...@ttiltd.com wrote: On Aug 10, 2011, at 9:52 AM, Daniel Pittman wrote: On Wed, Aug 10, 2011 at 16:40, Craig White craig.wh...@ttiltd.com wrote: Seems I don't quite understand how it's supposed to work At the moment, I have it inside a 'file' resource content = generate(/etc/puppet/scripts/ldap-add-host.sh $fqdn admins_all), generate(/etc/puppet/scripts/ldap-add-hosh.sh, $fqdn, admins_all) that worked great but brings me to a place I can't figure out. A file resource doesn't have 'unless' or 'onlyif' and thus it seems to execute every time. An exec resource doesn't have 'content' but does have command and 'unless' so it would seem exec would be a better way to go but... # Puppet maintained file /etc/puppet/deployment_files/ldap_admins_all exec{/etc/puppet/deployment_files/ldap_admins_all: command = ['/bin/touch /etc/puppet/deployment_files/admins_all', generate(/etc/puppet/scripts/ldap-add-host.sh, $fqdn, admins_all)], unless = /bin/ls -l /etc/puppet/deployment_files/ldap_admins_all, require = Class[mod_puppet::deployment_files], } gives me the error... err: Failed to apply catalog: private method `split' called for #Array:0x4873be8 Yeah. So, that is a totally awful error message. The `command` needs to be a string, not an array, but the exec type isn't checking that, it just fails trying to call the Ruby `split` method on it. Which doesn't work. :) That said, it isn't entirely clear to me what you are trying to do. The `generate` function runs a command on the Puppet master while the catalog is being compiled, but an `exec` resource is run on the client. Generally, you use `generate` to allow you to query an external data source. Is your `ldap-add-host.sh` script doing that query, or does it actually create things? If the later, is it idempotent - will it do the same thing if you run it twice? Finally, you need multiple `exec` resources (or a shell script) if you want to run multiple commands. Generally, best to be explicit about that, so you would separate the touch and the running of your script. Anyway, at a guess, `generate` is not at all what you want to do, and you should try and forget about it. Instead, make the `ldap-add-host.sh` script create the lock on disk, and then just run that internally. Daniel -- ⎋ Puppet Labs Developer – http://puppetlabs.com ♲ Made with 100 percent post-consumer electrons -- 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] generate function
On Aug 10, 2011, at 11:14 AM, Daniel Pittman wrote: On Wed, Aug 10, 2011 at 17:56, Craig White craig.wh...@ttiltd.com wrote: On Aug 10, 2011, at 9:52 AM, Daniel Pittman wrote: On Wed, Aug 10, 2011 at 16:40, Craig White craig.wh...@ttiltd.com wrote: Seems I don't quite understand how it's supposed to work At the moment, I have it inside a 'file' resource content = generate(/etc/puppet/scripts/ldap-add-host.sh $fqdn admins_all), generate(/etc/puppet/scripts/ldap-add-hosh.sh, $fqdn, admins_all) that worked great but brings me to a place I can't figure out. A file resource doesn't have 'unless' or 'onlyif' and thus it seems to execute every time. An exec resource doesn't have 'content' but does have command and 'unless' so it would seem exec would be a better way to go but... # Puppet maintained file /etc/puppet/deployment_files/ldap_admins_all exec{/etc/puppet/deployment_files/ldap_admins_all: command = ['/bin/touch /etc/puppet/deployment_files/admins_all', generate(/etc/puppet/scripts/ldap-add-host.sh, $fqdn, admins_all)], unless = /bin/ls -l /etc/puppet/deployment_files/ldap_admins_all, require = Class[mod_puppet::deployment_files], } gives me the error... err: Failed to apply catalog: private method `split' called for #Array:0x4873be8 Yeah. So, that is a totally awful error message. The `command` needs to be a string, not an array, but the exec type isn't checking that, it just fails trying to call the Ruby `split` method on it. Which doesn't work. :) That said, it isn't entirely clear to me what you are trying to do. The `generate` function runs a command on the Puppet master while the catalog is being compiled, but an `exec` resource is run on the client. Generally, you use `generate` to allow you to query an external data source. Is your `ldap-add-host.sh` script doing that query, or does it actually create things? If the later, is it idempotent - will it do the same thing if you run it twice? Finally, you need multiple `exec` resources (or a shell script) if you want to run multiple commands. Generally, best to be explicit about that, so you would separate the touch and the running of your script. Anyway, at a guess, `generate` is not at all what you want to do, and you should try and forget about it. Instead, make the `ldap-add-host.sh` script create the lock on disk, and then just run that internally. what I am trying to do is execute a shell script on the puppetmaster... essentially add 'host' attribute to specific ldap users. That's why the command has parameters... shellscript HOSTNAME GROUP the script is more than capable of getting the users from GROUP, adding host attribute HOSTNAME to each of the users but it must run on the puppetmaster, not on puppet clients which is why I am using the generate function. So in answer to your question, my ldap-add-host.sh script is actually creating things. yes, it is idempotent - I can run it and run it and it will always do the same thing but and if uid=craig already has 'host' ubuntu.ttinet, it will simply move on if I try to add it again. I could almost live with that except that if I manually remove 'host' ubuntu.ttinet from uid=craig, the next pass it will add it again so I need some method of tracking it so therefore I was trying to use 'unless' which is only available in an exec resource, not a file resource. I suppose if I had no alternative, I could maintain a list on the puppetmaster of which hosts have already been added to which groups and abort if it has already been done. 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.
Re: [Puppet Users] generate function
On Wed, Aug 10, 2011 at 18:31, Craig White craig.wh...@ttiltd.com wrote: On Aug 10, 2011, at 11:14 AM, Daniel Pittman wrote: On Wed, Aug 10, 2011 at 17:56, Craig White craig.wh...@ttiltd.com wrote: On Aug 10, 2011, at 9:52 AM, Daniel Pittman wrote: On Wed, Aug 10, 2011 at 16:40, Craig White craig.wh...@ttiltd.com wrote: Seems I don't quite understand how it's supposed to work At the moment, I have it inside a 'file' resource content = generate(/etc/puppet/scripts/ldap-add-host.sh $fqdn admins_all), generate(/etc/puppet/scripts/ldap-add-hosh.sh, $fqdn, admins_all) that worked great but brings me to a place I can't figure out. A file resource doesn't have 'unless' or 'onlyif' and thus it seems to execute every time. An exec resource doesn't have 'content' but does have command and 'unless' so it would seem exec would be a better way to go but... # Puppet maintained file /etc/puppet/deployment_files/ldap_admins_all exec{/etc/puppet/deployment_files/ldap_admins_all: command = ['/bin/touch /etc/puppet/deployment_files/admins_all', generate(/etc/puppet/scripts/ldap-add-host.sh, $fqdn, admins_all)], unless = /bin/ls -l /etc/puppet/deployment_files/ldap_admins_all, require = Class[mod_puppet::deployment_files], } gives me the error... err: Failed to apply catalog: private method `split' called for #Array:0x4873be8 Yeah. So, that is a totally awful error message. The `command` needs to be a string, not an array, but the exec type isn't checking that, it just fails trying to call the Ruby `split` method on it. Which doesn't work. :) That said, it isn't entirely clear to me what you are trying to do. The `generate` function runs a command on the Puppet master while the catalog is being compiled, but an `exec` resource is run on the client. Generally, you use `generate` to allow you to query an external data source. Is your `ldap-add-host.sh` script doing that query, or does it actually create things? If the later, is it idempotent - will it do the same thing if you run it twice? Finally, you need multiple `exec` resources (or a shell script) if you want to run multiple commands. Generally, best to be explicit about that, so you would separate the touch and the running of your script. Anyway, at a guess, `generate` is not at all what you want to do, and you should try and forget about it. Instead, make the `ldap-add-host.sh` script create the lock on disk, and then just run that internally. what I am trying to do is execute a shell script on the puppetmaster... essentially add 'host' attribute to specific ldap users. That's why the command has parameters... shellscript HOSTNAME GROUP OK. the script is more than capable of getting the users from GROUP, adding host attribute HOSTNAME to each of the users but it must run on the puppetmaster, not on puppet clients which is why I am using the generate function. So in answer to your question, my ldap-add-host.sh script is actually creating things. yes, it is idempotent - I can run it and run it and it will always do the same thing but and if uid=craig already has 'host' ubuntu.ttinet, it will simply move on if I try to add it again. I could almost live with that except that if I manually remove 'host' ubuntu.ttinet from uid=craig, the next pass it will add it again so I need some method of tracking it so therefore I was trying to use 'unless' which is only available in an exec resource, not a file resource. I suppose if I had no alternative, I could maintain a list on the puppetmaster of which hosts have already been added to which groups and abort if it has already been done. OK. So, yeah. `generate` doesn't do what you want: functions don't take parameters of any sort, let alone resource level metaparameters. You will need to implement all your logic in the script you invoke from generate, so that it will avoid doing things twice when called with the same arguments. ...and if you are wondering why this seems so hard? This really isn't something that Puppet is designed to support. Generally, modifying external data sources from Puppet like you are trying to do isn't really the way we approach things. Better, we feel, to modify the external data source and then draw read-only from that into the manifest. So, rather than calling generate to modify LDAP, instead modify LDAP and have code in your manifest to do whatever stuff when the LDAP changes have been applied. You can do it the way you are trying, more or less, but you really don't get much help from the tool.s Daniel -- ⎋ Puppet Labs Developer – http://puppetlabs.com ♲ Made with 100 percent post-consumer electrons -- 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
Re: [Puppet Users] ANNOUNCE: Puppet Module Tool version 0.3.4
I don't see any statement claiming that it'll automagically get put into the right place. On Tue, Aug 9, 2011 at 6:35 PM, John Warburton jwarbur...@gmail.com wrote: On 10 August 2011 11:24, Scott Smith sc...@ohlol.net wrote: How will it know which directory in your modulepath to install it? That's the point. You need to explicitly cd to the correct modulepath directory first. Per my example at the bottom $ cd /path/to/forge/modules $ puppet-module install puppetlabs-lvm 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-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] sync custom facts to puppet client
I've tried to sync custom facts to puppet client 2.6.7 with no luck. Could you please give me advise? placed custom facts in /etc/puppet/modules/cutom/lib/facter directory (empty init.pp file created as well) edited puppet.conf to add following pluginsync = true modulepath = /etc/puppet/modules -- 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 Module Tool version 0.3.4
Hi Scott, I think its fair enough thing to expect it to do something like this ... Incidentally, there is already a feature request for this: http://projects.puppetlabs.com/issues/3789 Do you want to watch/vote for it ...? Or you can always provide a patch ... we won't complain :-). ken. On Wed, Aug 10, 2011 at 8:13 PM, Scott Smith sc...@ohlol.net wrote: I don't see any statement claiming that it'll automagically get put into the right place. On Tue, Aug 9, 2011 at 6:35 PM, John Warburton jwarbur...@gmail.com wrote: On 10 August 2011 11:24, Scott Smith sc...@ohlol.net wrote: How will it know which directory in your modulepath to install it? That's the point. You need to explicitly cd to the correct modulepath directory first. Per my example at the bottom $ cd /path/to/forge/modules $ puppet-module install puppetlabs-lvm 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-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. -- Join us for PuppetConf, September 22nd and 23rd in Portland, OR: http://bit.ly/puppetconfsig; -- 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] sync custom facts to puppet client
Hi Steve, Did you add pluginsync = true on the client? Is it in the [agent] or [main] section? What happens when you just do: puppet agent -t --pluginsync (obviously inserting any other switches you normally require) ken. On Wed, Aug 10, 2011 at 8:22 PM, Steve some1youk...@gmail.com wrote: I've tried to sync custom facts to puppet client 2.6.7 with no luck. Could you please give me advise? placed custom facts in /etc/puppet/modules/cutom/lib/facter directory (empty init.pp file created as well) edited puppet.conf to add following pluginsync = true modulepath = /etc/puppet/modules -- 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. -- Join us for PuppetConf, September 22nd and 23rd in Portland, OR: http://bit.ly/puppetconfsig; -- 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: Strange Could not find dependency error
That's strange but I had to rename nagios class to nagios-server and include it instead to fix the problem. Maybe it's related to that I have similar problem class nagios-client { include nagios::params, nagios::nrpe, nagios::plugins } class ssa::nagios-client { # include nagios-client include nagios::params, nagios::nrpe, nagios::plugins $nrpe_checks = [ cpu, uptime, mem, postfix ] nagios::nrpe::nrpe_check { $nrpe_checks: } } Note that in ssa::nagios-client include nagios-client did not work and I got similar error Could not find dependency ... on another resource and had to use include nagios::params, nagios::nrpe, nagios::plugins instead. Any idea what's going on here? Thanks On Aug 10, 9:04 pm, piavlo lolitus...@gmail.com wrote: Hi, I have the following: class nagios { include nagios::params file { [ ${nagios::params::nagios_confdir}, ${nagios::params::nagios_confdir}/app_alerts, ${nagios::params::nagios_confdir}/app_alerts/ssa, ${nagios::params::nagios_confdir}/app_alerts/ssa/ services ]: ensure = directory, owner = 'root', group = 'root', mode = 755, } define couchdb_check () { $couchdb_bind_address = localhost $couchdb_port = 5984 $couchdb_baseurl = http://${couchdb_bind_address}:$ {couchdb_port} $couchdb_url = ${couchdb_baseurl}/nagios_alerts/${name} nagios_service { ssa_${name}: target = ${nagios::params::nagios_confdir}/app_alerts/ssa/ services/${name}.cfg, use = pnp4nagios-service, service_description = couchdblookup($couchdb_url, desc), require = File[${nagios::params::nagios_confdir}/app_alerts/ ssa/services] } } } class ssa::nagios { include nagios nagios::couchdb_check { [check1, check2 ]: } } So there is ssa::nagios that includes nagios class but I get error err: Could not run Puppet configuration client: Could not find dependency File[/etc/nagios/conf.d/app_alerts/ssa/services] for Nagios_service[check1] at /etc/puppet/modules/nagios/manifests/init.pp: 32 Changed include nagios to require nagios - same error. Of course nagios::params::nagios_confdir=/etc/nagios/conf.d And nagios class is supposed to be evaluated before ssa::nagios - so how come it does not find the File dependency declared in the nagios class? Thanks Alex -- 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] Puppet Windows support
Hi all - I'm pretty new to puppet and have started diving into the deep end - very excited to ditch crappy scripts for the manifest concept! I have a couple of questions around windows support. I followed the windows support wiki entry to the bitter end and then realized there's no agent support. If I understand correctly, agents are installed on the machines you want to manage and the master server pushes out details to that agent about how that agent should configure that server. If there's currently no agent support, is there any point? The Platforms we support page for puppet claims Windows support - leaving me very confused. I also have found this ticket: http://projects.puppetlabs.com/issues/8268 That also suggests there's no agent support. PS - love what I'm seeing but it'd be HUGE if Windows was treated as a first class citizen. -- 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] N could not find class errors before success, where N is the number of included modules
Puppet 2.7.1 on all sides from Gems. Ubuntu 10.04 hosts, Ruby 1.8.7.249-2, RubyGems 1.3.5-1ubuntu2. Bug with details at http://projects.puppetlabs.com/issues/8801 . Any ideas out there? 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.
[Puppet Users] Re: Strange Could not find dependency error
After changing nagios-client to nagios::client and nagios-server(formely just nagios) to nagios::server All strange dependency have seem to gone away Does anyone have clear logical explanation why nagios::client nagios::server have no dep problems but nagios-client nagios-server does? Thanks On Aug 10, 10:38 pm, piavlo lolitus...@gmail.com wrote: That's strange but I had to rename nagios class to nagios-server and include it instead to fix the problem. Maybe it's related to that I have similar problem class nagios-client { include nagios::params, nagios::nrpe, nagios::plugins } class ssa::nagios-client { # include nagios-client include nagios::params, nagios::nrpe, nagios::plugins $nrpe_checks = [ cpu, uptime, mem, postfix ] nagios::nrpe::nrpe_check { $nrpe_checks: } } Note that in ssa::nagios-client include nagios-client did not work and I got similar error Could not find dependency ... on another resource and had to use include nagios::params, nagios::nrpe, nagios::plugins instead. Any idea what's going on here? Thanks On Aug 10, 9:04 pm, piavlo lolitus...@gmail.com wrote: Hi, I have the following: class nagios { include nagios::params file { [ ${nagios::params::nagios_confdir}, ${nagios::params::nagios_confdir}/app_alerts, ${nagios::params::nagios_confdir}/app_alerts/ssa, ${nagios::params::nagios_confdir}/app_alerts/ssa/ services ]: ensure = directory, owner = 'root', group = 'root', mode = 755, } define couchdb_check () { $couchdb_bind_address = localhost $couchdb_port = 5984 $couchdb_baseurl = http://${couchdb_bind_address}:$ {couchdb_port} $couchdb_url = ${couchdb_baseurl}/nagios_alerts/${name} nagios_service { ssa_${name}: target = ${nagios::params::nagios_confdir}/app_alerts/ssa/ services/${name}.cfg, use = pnp4nagios-service, service_description = couchdblookup($couchdb_url, desc), require = File[${nagios::params::nagios_confdir}/app_alerts/ ssa/services] } } } class ssa::nagios { include nagios nagios::couchdb_check { [check1, check2 ]: } } So there is ssa::nagios that includes nagios class but I get error err: Could not run Puppet configuration client: Could not find dependency File[/etc/nagios/conf.d/app_alerts/ssa/services] for Nagios_service[check1] at /etc/puppet/modules/nagios/manifests/init.pp: 32 Changed include nagios to require nagios - same error. Of course nagios::params::nagios_confdir=/etc/nagios/conf.d And nagios class is supposed to be evaluated before ssa::nagios - so how come it does not find the File dependency declared in the nagios class? Thanks Alex -- 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: sync custom facts to puppet client
running the 'puppet agent -t --pluginsync' command on client synced the custom facts and now it is working. Is this something that I need to run on every puppet agent in order to sync custom facts? Thank you On Aug 10, 12:25 pm, Ken Barber k...@puppetlabs.com wrote: Hi Steve, Did you add pluginsync = true on the client? Is it in the [agent] or [main] section? What happens when you just do: puppet agent -t --pluginsync (obviously inserting any other switches you normally require) ken. On Wed, Aug 10, 2011 at 8:22 PM, Steve some1youk...@gmail.com wrote: I've tried to sync custom facts to puppet client 2.6.7 with no luck. Could you please give me advise? placed custom facts in /etc/puppet/modules/cutom/lib/facter directory (empty init.pp file created as well) edited puppet.conf to add following pluginsync = true modulepath = /etc/puppet/modules -- 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 athttp://groups.google.com/group/puppet-users?hl=en. -- Join us for PuppetConf, September 22nd and 23rd in Portland, OR:http://bit.ly/puppetconfsig; -- 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: sync custom facts to puppet client
Yes - to sync facts to clients you need to run puppet with pluginsync enabled on the client. And like most puppet switches, as long as its in puppet.conf you won't need to include it on the command line: [agent] pluginsync = true So make sure you have that setting in your puppet.conf on all your clients. ken. On Wed, Aug 10, 2011 at 9:41 PM, Steve some1youk...@gmail.com wrote: running the 'puppet agent -t --pluginsync' command on client synced the custom facts and now it is working. Is this something that I need to run on every puppet agent in order to sync custom facts? Thank you On Aug 10, 12:25 pm, Ken Barber k...@puppetlabs.com wrote: Hi Steve, Did you add pluginsync = true on the client? Is it in the [agent] or [main] section? What happens when you just do: puppet agent -t --pluginsync (obviously inserting any other switches you normally require) ken. On Wed, Aug 10, 2011 at 8:22 PM, Steve some1youk...@gmail.com wrote: I've tried to sync custom facts to puppet client 2.6.7 with no luck. Could you please give me advise? placed custom facts in /etc/puppet/modules/cutom/lib/facter directory (empty init.pp file created as well) edited puppet.conf to add following pluginsync = true modulepath = /etc/puppet/modules -- 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 athttp://groups.google.com/group/puppet-users?hl=en. -- Join us for PuppetConf, September 22nd and 23rd in Portland, OR:http://bit.ly/puppetconfsig; -- 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. -- Join us for PuppetConf, September 22nd and 23rd in Portland, OR: http://bit.ly/puppetconfsig; -- 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] puppet-2.7.1/facter-1.6.0 still incorrectly reporting openvz hardware node as virtual machine
I recently installed puppet on a RHEL 6 test server to begin familiarizing myself with it. I'd originally installed puppet 2.6.8 and facter 1.5.9 and noticed the mis-identification. I found a fix here - https://github.com/saysjonathan/facter/commit/82c3ab7420bddd78bce267f11a4f301430b77578 After I applied the fix mentioned above, facter began returning the correct info. However, even though facter was now correct, the following manifest still returned virtual for the hardware node: if $is_virtual { notify {I am virtual!:} } else { notify {I am physical:} } So, are the facter results cached somewhere? What could account for the fact that facter output is correct, but the manifest still returns false data? I updated to puppet-2.7.1 and facter-1.6.0 and now facter and the manifest both report incorrectly that the hardware node is virtual. Any ideas on where I should look would be welcome. Jake -- 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] generate function
On Aug 10, 2011, at 11:50 AM, Daniel Pittman wrote: On Wed, Aug 10, 2011 at 18:31, Craig White craig.wh...@ttiltd.com wrote: what I am trying to do is execute a shell script on the puppetmaster... essentially add 'host' attribute to specific ldap users. That's why the command has parameters... shellscript HOSTNAME GROUP OK. the script is more than capable of getting the users from GROUP, adding host attribute HOSTNAME to each of the users but it must run on the puppetmaster, not on puppet clients which is why I am using the generate function. So in answer to your question, my ldap-add-host.sh script is actually creating things. yes, it is idempotent - I can run it and run it and it will always do the same thing but and if uid=craig already has 'host' ubuntu.ttinet, it will simply move on if I try to add it again. I could almost live with that except that if I manually remove 'host' ubuntu.ttinet from uid=craig, the next pass it will add it again so I need some method of tracking it so therefore I was trying to use 'unless' which is only available in an exec resource, not a file resource. I suppose if I had no alternative, I could maintain a list on the puppetmaster of which hosts have already been added to which groups and abort if it has already been done. OK. So, yeah. `generate` doesn't do what you want: functions don't take parameters of any sort, let alone resource level metaparameters. You will need to implement all your logic in the script you invoke from generate, so that it will avoid doing things twice when called with the same arguments. ...and if you are wondering why this seems so hard? This really isn't something that Puppet is designed to support. Generally, modifying external data sources from Puppet like you are trying to do isn't really the way we approach things. Better, we feel, to modify the external data source and then draw read-only from that into the manifest. So, rather than calling generate to modify LDAP, instead modify LDAP and have code in your manifest to do whatever stuff when the LDAP changes have been applied. You can do it the way you are trying, more or less, but you really don't get much help from the tool.s I modified my shell script to keep track of what has already been added to LDAP and return a constant result if already added. It's really neat how standard output from the generate command ends up as the content of a 'file' on the client but yes, the 'generate' command will run each time the puppet client runs because the only way it can decide what the content actually is going to be is by running again and comparing with the file that is (or isn't) on the client already. In my methodology, I already had a directory /etc/puppet/deployment_files for keeping track of things so it was a simple task to have file resources for things that really aren't a file on a normal server but triggers for actions (or inaction) by puppet. I never really wondered why or even thought it was hard to accomplish this because I definitely understand that processing is really targeted at the client level. But I am sure you understand the desire to integrate more than just the clients - in this case, we are dealing with a large set of knowns... - the new host/node - ldap configuration from the first puppet run that implements host based access control - the members of specific groups - the distribution of sudoers 'include' files for these groups and thus the only missing link was the ability to actually be able to log into these hosts was for admins to have the host attributes set for the new hosts. This was separately scripted and I just needed the missing link and that was provided to me by generate... not perfect, not exactly how I would have wanted it but definitely workable. Thanks for the help - it was invaluable and made this a relatively simple task 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.
Re: [Puppet Users] Puppet Windows support
I think if you look through the mail list for the past 6 weeks, you'll see several postings about the progress that they have made towards a Windows client. I gather that this is on the high priority agenda. Craig On Aug 10, 2011, at 12:37 PM, Maven User wrote: Hi all - I'm pretty new to puppet and have started diving into the deep end - very excited to ditch crappy scripts for the manifest concept! I have a couple of questions around windows support. I followed the windows support wiki entry to the bitter end and then realized there's no agent support. If I understand correctly, agents are installed on the machines you want to manage and the master server pushes out details to that agent about how that agent should configure that server. If there's currently no agent support, is there any point? The Platforms we support page for puppet claims Windows support - leaving me very confused. I also have found this ticket: http://projects.puppetlabs.com/issues/8268 That also suggests there's no agent support. PS - love what I'm seeing but it'd be HUGE if Windows was treated as a first class citizen. -- 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. -- Craig White ~~ craig.wh...@ttiltd.com 1.800.869.6908 ~~~ www.ttiassessments.com Need help communicating between generations at work to achieve your desired success? Let us help! -- 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: Handling ENC / Class interface changes
Thanks for the replies so far from all. It does seem like it is both a problem with the fact that I decided to explicitly version our application modules and provide a mechanism for tieing configuration blueprints in the ENC side to the version of the application module in use, but no such mechanism for our common modules which naively I had expected to remain relatively static. So the ultimate solution may be to provide versioning in a similar way, but by utilising the class interface specifications already generated by introspection. I'm not sure what I would get from resource_type in addition to what I already have, since it means some additional work for every class to be called... surely there will be a performance overhead. The only remaining question is how to then tie configuration data which now is the only static data coming into the ENC from the user, with the class interfaces coming from the Puppet code. I expect I'll puzzle over this over the next week and report back ;) -- 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 Windows support
Yeah, Windows users! The 2.6 release introduced preliminary support for Windows (limited to just managing files). http://www.puppetlabs.com/2dot6/ The ticket you found provides a good view of the work we have completed and are targeting for the release. http://projects.puppetlabs.com/issues/8268 In particular, we will be adding providers for file, exec, user, group, service, etc types. Some of these providers have already been implemented, others are actively being worked on. If you are interested in trying it out, you can download the source for facter and puppet from github (ignore the step about installing puppet and facter as gems as described in the wiki). Lets us know if you run into any issues. Josh -- Join us for PuppetConf http://bit.ly/puppetconfsig, September 22nd and 23rd in Portland, OR. On Wed, Aug 10, 2011 at 2:15 PM, Craig White craig.wh...@ttiltd.com wrote: I think if you look through the mail list for the past 6 weeks, you'll see several postings about the progress that they have made towards a Windows client. I gather that this is on the high priority agenda. Craig On Aug 10, 2011, at 12:37 PM, Maven User wrote: Hi all - I'm pretty new to puppet and have started diving into the deep end - very excited to ditch crappy scripts for the manifest concept! I have a couple of questions around windows support. I followed the windows support wiki entry to the bitter end and then realized there's no agent support. If I understand correctly, agents are installed on the machines you want to manage and the master server pushes out details to that agent about how that agent should configure that server. If there's currently no agent support, is there any point? The Platforms we support page for puppet claims Windows support - leaving me very confused. I also have found this ticket: http://projects.puppetlabs.com/issues/8268 That also suggests there's no agent support. PS - love what I'm seeing but it'd be HUGE if Windows was treated as a first class citizen. -- 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. -- Craig White ~~ craig.wh...@ttiltd.com 1.800.869.6908 ~~~ www.ttiassessments.com Need help communicating between generations at work to achieve your desired success? Let us help! -- 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. -- 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] Does Node Inheritance work for people?
[Following up a little late] Is anyone using node inheritance and happy with how it works? If so, can you describe your setup briefly? I make very limited use of node inheritance. I use node basenode { include $operatingsystem [other stuff I want absolutely everywhere] } node default inherits basenode{} node X inherits basenode { [more stuff] } I have little to add that the others haven't said, except to emphasize that the whole puppet inheritance model is broken. I'm increasingly of the opinion that, were I designing puppet 3, I would completely ditch the custom syntax in favor of a more straight-up ruby DSL and take advantage of ruby inheritance abilities. Darrell -- You received this message because you are subscribed to the Google Groups Puppet Users group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
[Puppet Users] Re: Puppet Windows support
In the simplest sense - I'd need to deploy a webapp, cycle a service (tomcat and IIS) and apply a set of changes to a bunch of configuration files. From what I can tell, the agent portion of puppet isn't ready for prime time. Isn't the agent the portion of puppet that runs on every server that is needed to apply changes on a given system? Thanks all for the replies!!! On Aug 10, 6:52 pm, Josh Cooper j...@puppetlabs.com wrote: Yeah, Windows users! The 2.6 release introduced preliminary support for Windows (limited to just managing files). http://www.puppetlabs.com/2dot6/ The ticket you found provides a good view of the work we have completed and are targeting for the release. http://projects.puppetlabs.com/issues/8268 In particular, we will be adding providers for file, exec, user, group, service, etc types. Some of these providers have already been implemented, others are actively being worked on. If you are interested in trying it out, you can download the source for facter and puppet from github (ignore the step about installing puppet and facter as gems as described in the wiki). Lets us know if you run into any issues. Josh -- Join us for PuppetConf http://bit.ly/puppetconfsig, September 22nd and 23rd in Portland, OR. On Wed, Aug 10, 2011 at 2:15 PM, Craig White craig.wh...@ttiltd.com wrote: I think if you look through the mail list for the past 6 weeks, you'll see several postings about the progress that they have made towards a Windows client. I gather that this is on the high priority agenda. Craig On Aug 10, 2011, at 12:37 PM, Maven User wrote: Hi all - I'm pretty new to puppet and have started diving into the deep end - very excited to ditch crappy scripts for the manifest concept! I have a couple of questions around windows support. I followed the windows support wiki entry to the bitter end and then realized there's no agent support. If I understand correctly, agents are installed on the machines you want to manage and the master server pushes out details to that agent about how that agent should configure that server. If there's currently no agent support, is there any point? The Platforms we support page for puppet claims Windows support - leaving me very confused. I also have found this ticket: http://projects.puppetlabs.com/issues/8268 That also suggests there's no agent support. PS - love what I'm seeing but it'd be HUGE if Windows was treated as a first class citizen. -- 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. -- Craig White ~~ craig.wh...@ttiltd.com 1.800.869.6908 ~~~www.ttiassessments.com Need help communicating between generations at work to achieve your desired success? Let us help! -- 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. -- 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] Does Node Inheritance work for people?
ENC + include/require = no need for inheritance. Classify roles for your servers, assign classes and parameters to the roles. On Wed, Aug 10, 2011 at 4:33 PM, Darrell Fuhriman darr...@garnix.orgwrote: [Following up a little late] Is anyone using node inheritance and happy with how it works? If so, can you describe your setup briefly? I make very limited use of node inheritance. I use node basenode { include $operatingsystem [other stuff I want absolutely everywhere] } node default inherits basenode{} node X inherits basenode { [more stuff] } I have little to add that the others haven't said, except to emphasize that the whole puppet inheritance model is broken. I'm increasingly of the opinion that, were I designing puppet 3, I would completely ditch the custom syntax in favor of a more straight-up ruby DSL and take advantage of ruby inheritance abilities. Darrell -- 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. -- 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] generate function
Sounds like a job better suited for ENC/inventory. IMO. On Wed, Aug 10, 2011 at 2:13 PM, Craig White craig.wh...@ttiltd.com wrote: On Aug 10, 2011, at 11:50 AM, Daniel Pittman wrote: On Wed, Aug 10, 2011 at 18:31, Craig White craig.wh...@ttiltd.com wrote: what I am trying to do is execute a shell script on the puppetmaster... essentially add 'host' attribute to specific ldap users. That's why the command has parameters... shellscript HOSTNAME GROUP OK. the script is more than capable of getting the users from GROUP, adding host attribute HOSTNAME to each of the users but it must run on the puppetmaster, not on puppet clients which is why I am using the generate function. So in answer to your question, my ldap-add-host.sh script is actually creating things. yes, it is idempotent - I can run it and run it and it will always do the same thing but and if uid=craig already has 'host' ubuntu.ttinet, it will simply move on if I try to add it again. I could almost live with that except that if I manually remove 'host' ubuntu.ttinet from uid=craig, the next pass it will add it again so I need some method of tracking it so therefore I was trying to use 'unless' which is only available in an exec resource, not a file resource. I suppose if I had no alternative, I could maintain a list on the puppetmaster of which hosts have already been added to which groups and abort if it has already been done. OK. So, yeah. `generate` doesn't do what you want: functions don't take parameters of any sort, let alone resource level metaparameters. You will need to implement all your logic in the script you invoke from generate, so that it will avoid doing things twice when called with the same arguments. ...and if you are wondering why this seems so hard? This really isn't something that Puppet is designed to support. Generally, modifying external data sources from Puppet like you are trying to do isn't really the way we approach things. Better, we feel, to modify the external data source and then draw read-only from that into the manifest. So, rather than calling generate to modify LDAP, instead modify LDAP and have code in your manifest to do whatever stuff when the LDAP changes have been applied. You can do it the way you are trying, more or less, but you really don't get much help from the tool.s I modified my shell script to keep track of what has already been added to LDAP and return a constant result if already added. It's really neat how standard output from the generate command ends up as the content of a 'file' on the client but yes, the 'generate' command will run each time the puppet client runs because the only way it can decide what the content actually is going to be is by running again and comparing with the file that is (or isn't) on the client already. In my methodology, I already had a directory /etc/puppet/deployment_files for keeping track of things so it was a simple task to have file resources for things that really aren't a file on a normal server but triggers for actions (or inaction) by puppet. I never really wondered why or even thought it was hard to accomplish this because I definitely understand that processing is really targeted at the client level. But I am sure you understand the desire to integrate more than just the clients - in this case, we are dealing with a large set of knowns... - the new host/node - ldap configuration from the first puppet run that implements host based access control - the members of specific groups - the distribution of sudoers 'include' files for these groups and thus the only missing link was the ability to actually be able to log into these hosts was for admins to have the host attributes set for the new hosts. This was separately scripted and I just needed the missing link and that was provided to me by generate... not perfect, not exactly how I would have wanted it but definitely workable. Thanks for the help - it was invaluable and made this a relatively simple task 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. -- 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: Puppet Windows support
On Wed, Aug 10, 2011 at 6:02 PM, Maven User maven.2.u...@gmail.com wrote: In the simplest sense - I'd need to deploy a webapp, cycle a service (tomcat and IIS) and apply a set of changes to a bunch of configuration files. From what I can tell, the agent portion of puppet isn't ready for prime time. Version 2.6 of the puppet agent should be able to manage Windows file resources, though it does not support managing (start, stop, etc) services. However, when we complete Windows agent support (ticket 8268 and related subtasks), your use case should be supported. Note that 2.6 is in maintenance mode, with active development, generally speaking, occurring in 2.7 and future releases. The windows agent support described in ticket 8268 will not be available in 2.6. Josh -- Join us for PuppetConf http://www.bit.ly/puppetconfsig, September 22nd and 23rd in Portland, OR. -- 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.