[Puppet Users] Re: Puppetdb [io.nio] javax.net.ssl.SSLHandshakeException: null cert chain
Try this and see, It might help. 0) Stop puppetdb 1) remove PuppetDB's SSL directory entirely (usually /etc/puppetdb/ssl) 2) make sure that the agent on the puppetdb machine can run successfully against the master (puppet agent --test, sounds like you've already done this. 3) Run the puppetdb-ssl-setup script (which should be in your sbin directory) 4) Restart puppetdb Regards Sai. On Tuesday, August 27, 2013 8:58:27 PM UTC-4, Stephen Wallace wrote: Han outstanding bug - http://projects.puppetlabs.com/issues/20838 Stephen On Tuesday, 27 August 2013 17:45:28 UTC+10, Stephen Wallace wrote: Hi, I'm trying to layer out PE3 as follows; 1) Puppet console / Active CA (autosigning) 2) Puppet Master (non-CA) 3) PuppetDB 4) Puppet Client - for testing 5) HAProxy presenting the puppet service address, forwarding 443 to the console, and 8140 to the PM. (Let's not worry about MCollective yet) The PM and PuppetDB both had their certs signed against the Console / CA, and both can do a puppet agent -t I've setup the SSL proxying on the PM1 as follows; # # Enable SSLProxyEngine for proxying SSL connections SSLProxyEngine On # Disable PassengerHighPerformance because of proxy_http -% PassengerHighPerformance Off # Add the mod_proxy redirect -% ProxyPassMatch ^/([^/]+/certificate.*)$ https://puppetcon.puppetlabs.net:8140/$1 #ProxyPassReverse ^/([^/]+/certificate.*)$ https://puppetcon.puppetlabs.net:8140/$1 # When I initially run puppet agent -t on the client, the CSR is generated, and signed on the CA. There are errors all subsequent runs from the client; [root@puppetclient puppet]# /opt/puppet/bin/puppet agent -t Warning: Unable to fetch my node definition, but the agent run will continue: Warning: Error 400 on SERVER: Could not retrieve facts for puppetclient.puppetlabs.net: Failed to find facts from PuppetDB at puppetdb.puppetlabs.net:8081: SSL_connect SYSCALL returned=5 errno=0 state=SSLv3 read finished A Info: Retrieving plugin Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/puppet_vardir.rb ( snip) Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/custom_auth_conf.rb Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/concat_basedir.rb Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Failed to submit 'replace facts' command for puppetclient.puppetlabs.net to PuppetDB at puppetdb.puppetlabs.net:8081: SSL_connect SYSCALL returned=5 errno=0 state=SSLv3 read finished A Warning: Not using cache on failed catalog Error: Could not retrieve catalog; skipping run The error appears to be an SSL issue associated with talking to PuppetDB as per the following entry in the puppetdb.log file. [io.nio] javax.net.ssl.SSLHandshakeException: null cert chain My java/jre stuff currently installed is as follows; root@puppetdb:/var/log/pe-puppetdb# dpkg -l|grep jre rc openjdk-6-jre-headless6b27-1.12.6-1ubuntu0.12.04.2 OpenJDK Java runtime, using Hotspot JIT (headless) rc openjdk-7-jre-headless7u25-2.3.10-1ubuntu0.12.04.2 OpenJDK Java runtime, using Hotspot JIT (headless) root@puppetdb:/var/log/pe-puppetdb# dpkg -l|grep java rc ca-certificates-java 20110912ubuntu6 Common CA certificates (JKS keystore) ii java-common 0.43ubuntu2 Base of all Java packages ii pe-java 1.7.0.19-1puppet1 OpenJDK Development Kit (JDK) ii tzdata-java 2012e-0ubuntu0.12.04.1 time zone and daylight-saving time data for use by java runtimes root@puppetdb:/var/log/pe-puppetdb# JAVA_HOME, or any of this sort of variable is not set in my env. I did see this one which talks about the issue, but no resolutions? https://groups.google.com/forum/#!msg/puppet-users/iD3gYQPDH2Q/zhASUzRhK7EJ Any assistance would be greatly appreciated! Regs, Stephen -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
[Puppet Users] Re: Cisco SAN switch support?
Cisco is going to come up with puppet modules for configuration management . Heard this recently @Boston Puppet Conf. On Tuesday, July 2, 2013 9:33:02 AM UTC-4, cncook001 wrote: Has anyone tried to make puppet control Cisco SAN switches? Craig -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
[Puppet Users] Console: Live Management Supported Platforms.
Puppet agent live management from puppet dashboard supported on all platforms in PE 3.0? Solaris, Windows, etc. Regards Sai. EMC Corporation -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
[Puppet Users] Puppet Faces - REST
How do I expose a Custom Puppet Face via REST API. Same as catalog or facts or node REST API Couldn't find any resources on this. Any links to examples or write up's on this? Thank You. Regards Sai. EMC Corporation -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Puppet Users] gem packages installed directory on puppetmaster
Felix , Thanks for your reply. Please see the below thread. I deleted this post, because my title was'nt clear. Not sure how it showed up again. Yes, I did removed old hiera and updated new one. Still no use. https://groups.google.com/forum/?hl=enfromgroups#!topic/puppet-users/Fueb5cXA9Fg Regards Sai. On Monday, February 25, 2013 8:28:29 AM UTC-5, Felix.Frank wrote: Hi, I don't really understand the problem. On 02/22/2013 07:29 PM, Sai_Emc wrote: /opt/puppet/lib/gems/1.8/gems/hiera-0.3.0 /opt/puppet/lib/gems/1.8/gems/hiera-puppet-0.3.0 Later when I updated to new version of hiera then it installed (via gem install) under /opt/puppet/lib/gems/1.8/gems/hiera-1.1.1 /opt/puppet/lib/gems/1.8/gems/hiera-puppet-1.0.0 Are these not the same base directories? It's not really clear why one would work and not the other. /opt/puppet/lib/site_ruby/1.8/puppet/parser/functions/hiera_include.rb Do you have this file? Or is ruby looking for that? You may need to fix your RUBYLIB environment. Have you tried reinstalling the older hiera version. HTH, Felix -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
[Puppet Users] Re: puppet could'nt find hiera even when hiera gem is installed
This issue got resolved. Looks like hiera functions created as a softlink under site_ruby. /opt/puppet/lib/site_ruby/1.8/puppet/parser/functions total 112 lrwxrwxrwx 1 root root 84 Jun 20 2012 hiera.rb - ../../../../../gems/1.8/gems/hiera-puppet-0.3.0/lib/puppet/parser/functions/hiera.rb lrwxrwxrwx 1 root root 92 Jun 20 2012 hiera_include.rb - ../../../../../gems/1.8/gems/hiera-puppet-0.3.0/lib/puppet/parser/functions/hiera_include.rb lrwxrwxrwx 1 root root 89 Jun 20 2012 hiera_hash.rb - ../../../../../gems/1.8/gems/hiera-puppet-0.3.0/lib/puppet/parser/functions/hiera_hash.rb lrwxrwxrwx 1 root root 90 Jun 20 2012 hiera_array.rb - ../../../../../gems/1.8/gems/hiera-puppet-0.3.0/lib/puppet/parser/functions/hiera_a When I uninstalled older version hiera my links were never removed. I was'nt aware of these links. So even after installing new hiera/hiera-puppet my links were pointing to a packaged which does not exist. So hiera functions were failing in puppet. Which makes sense. So I corrected my softlinks to point latest hiera-puppet then hiera started working. Regards Sai. On Friday, February 22, 2013 4:05:30 PM UTC-5, Sai_Emc wrote: Tried /opt/puppet/bin/gem , no use puppet is still failing with errors err: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not autoload hiera_include: no such file to load -- /opt/puppet/lib/site_ruby/1.8/puppet/parser/functions/hiera_include.rb at /etc/puppetlabs/puppet/environments/development/manifests/site.pp:46 I can see gem -list --local shows hiera gems installed. /opt/puppet/bin$ /opt/puppet/bin/gem list --local *** LOCAL GEMS *** activerecord (2.3.14) activesupport (2.3.14) ar-extensions (0.9.5) builder (3.0.0) dalli (1.1.2) excon (0.14.1) fog (1.5.0) formatador (0.2.0) guid (0.1.1) hiera (1.1.2) hiera-puppet (1.0.0) Regards Sai. EMC On Friday, February 22, 2013 3:07:41 PM UTC-5, llowder wrote: On Friday, February 22, 2013 2:03:30 PM UTC-6, Sai_Emc wrote: Hiera was properly working in my environment. But puppet was looking at old version even when I have the latest hiera gem installed. So I could'nt use json backend. But puppet is not looking at my latest hiera gem. Not sure when went wrong here. Scenario: I have installed hiera couple of months back. So the gem was installed under /opt/puppet/lib/gems/1.8/gems/hiera-0.3.0 /opt/puppet/lib/gems/1.8/gems/hiera-puppet-0.3.0 Later when I updated to new version of hiera then it installed (via gem install) under /opt/puppet/lib/gems/1.8/gems/hiera-1.1.1 /opt/puppet/lib/gems/1.8/gems/hiera-puppet-1.0.0 Puppet was always using the hiera under /opt/puppet/lib/gems/1.8/gems/, so I was unable to use new features of hiera I have uninstalled hiera-0.3.0 manually using gem sudo gem uninstall --install-dir /opt/puppet/lib/gems/1.8/ hiera Then Puppet failed to find hiera() function, so its always looking under /opt/puppet/lib/gems/1.8/gems. Later I installed hiera using gem and explicitly specified to install under /opt/puppet/lib/gems/1.8/gems Now puppet cannot even find hiera() err: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not autoload hiera_include: no such file to load -- /opt/puppet/lib/site_ruby/1.8/puppet/parser/functions/hiera_include.rb at /etc/puppetlabs/puppet/environments/development/manifests/site.pp:46 on node Looks like some thing wrong with my gem path or my puppet load path is not. Any idea what went wrong here? Using Ubuntu12.04LTS, PE 2.7, Hiera1.2 Any help greatly appreciated. Try sudo /opt/puppet/bin/gem install hiera I'm not a PE user, but I think that is the right path. Regards Sai. EMC -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
[Puppet Users] gem packages installed directory on puppetmaster
What is the right path for ruby gems on puppet master. Scenario: I have installed hiera couple of months back. So the gem was installed under /opt/puppet/lib/gems/1.8/gems/hiera-0.3.0 /opt/puppet/lib/gems/1.8/gems/hiera-puppet-0.3.0 Later when I updated to new version of hiera then it installed (via gem install) under /opt/puppet/lib/gems/1.8/gems/hiera-1.1.1 /opt/puppet/lib/gems/1.8/gems/hiera-puppet-1.0.0 Puppet was always using the hiera under /opt/puppet/lib/gems/1.8/gems/, so I was unable to use new features of hiera I have uninstalled hiera-0.3.0 manually using gem sudo gem uninstall --install-dir /opt/puppet/lib/gems/1.8/ hiera Then Puppet failed to find hiera() function, so its always looking under /opt/puppet/lib/gems/1.8/gems. Later I installed hiera using gem and explicitly specified to install under /opt/puppet/lib/gems/1.8/gems Now puppet cannot even find hiera() err: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not autoload hiera_include: no such file to load -- /opt/puppet/lib/site_ruby/1.8/puppet/parser/functions/hiera_include.rb at /etc/puppetlabs/puppet/environments/development/manifests/site.pp:46 on node Looks like some thing wrong with my gem path or my puppet load path is not. How do I come out of this? Any help greatly appreciated. Regards Sai. EMC -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
[Puppet Users] Re: gem packages installed directory on puppetmaster
Forgot to add my environment details. Ubuntu12.04LTS, PE 2.7, Hiera1.2 Regards Sai. On Friday, February 22, 2013 1:29:45 PM UTC-5, Sai_Emc wrote: What is the right path for ruby gems on puppet master. Scenario: I have installed hiera couple of months back. So the gem was installed under /opt/puppet/lib/gems/1.8/gems/hiera-0.3.0 /opt/puppet/lib/gems/1.8/gems/hiera-puppet-0.3.0 Later when I updated to new version of hiera then it installed (via gem install) under /opt/puppet/lib/gems/1.8/gems/hiera-1.1.1 /opt/puppet/lib/gems/1.8/gems/hiera-puppet-1.0.0 Puppet was always using the hiera under /opt/puppet/lib/gems/1.8/gems/, so I was unable to use new features of hiera I have uninstalled hiera-0.3.0 manually using gem sudo gem uninstall --install-dir /opt/puppet/lib/gems/1.8/ hiera Then Puppet failed to find hiera() function, so its always looking under /opt/puppet/lib/gems/1.8/gems. Later I installed hiera using gem and explicitly specified to install under /opt/puppet/lib/gems/1.8/gems Now puppet cannot even find hiera() err: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not autoload hiera_include: no such file to load -- /opt/puppet/lib/site_ruby/1.8/puppet/parser/functions/hiera_include.rb at /etc/puppetlabs/puppet/environments/development/manifests/site.pp:46 on node Looks like some thing wrong with my gem path or my puppet load path is not. How do I come out of this? Any help greatly appreciated. Regards Sai. EMC -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
[Puppet Users] puppet could'nt find hiera even when hiera gem is installed
Hiera was properly working in my environment. But puppet was looking at old version even when I have the latest hiera gem installed. So I could'nt use json backend. But puppet is not looking at my latest hiera gem. Not sure when went wrong here. Scenario: I have installed hiera couple of months back. So the gem was installed under /opt/puppet/lib/gems/1.8/gems/hiera-0.3.0 /opt/puppet/lib/gems/1.8/gems/hiera-puppet-0.3.0 Later when I updated to new version of hiera then it installed (via gem install) under /opt/puppet/lib/gems/1.8/gems/hiera-1.1.1 /opt/puppet/lib/gems/1.8/gems/hiera-puppet-1.0.0 Puppet was always using the hiera under /opt/puppet/lib/gems/1.8/gems/, so I was unable to use new features of hiera I have uninstalled hiera-0.3.0 manually using gem sudo gem uninstall --install-dir /opt/puppet/lib/gems/1.8/ hiera Then Puppet failed to find hiera() function, so its always looking under /opt/puppet/lib/gems/1.8/gems. Later I installed hiera using gem and explicitly specified to install under /opt/puppet/lib/gems/1.8/gems Now puppet cannot even find hiera() err: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not autoload hiera_include: no such file to load -- /opt/puppet/lib/site_ruby/1.8/puppet/parser/functions/hiera_include.rb at /etc/puppetlabs/puppet/environments/development/manifests/site.pp:46 on node Looks like some thing wrong with my gem path or my puppet load path is not. Any idea what went wrong here? Using Ubuntu12.04LTS, PE 2.7, Hiera1.2 Any help greatly appreciated. Regards Sai. EMC -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
[Puppet Users] Re: Puppet-Hiera: hiera_include and hiera_hash behaviour
I can see json_backend working in latest hiera. Tried from command line its working . puppetmaster was looking at old hiera-0.3.0 gem even whem latest hiera is installed. Posted a different topic for that. Thanks. Sai EMC On Thursday, February 21, 2013 5:50:32 PM UTC-5, Sai_Emc wrote: Wonderful...This is cool. As you said, maintaining thousands yaml files manually might be difficlut. I have to automate this process to accept requests from an external system about which node needs which resources. So I might use json over yaml, because at this point I dont know my external system can do yaml. Any idea json backend supported in 2.7?. I saw in the documentation but not sure supported in 2.7 or not. Once again thank you very much. Regards Sai. EMC On Thursday, February 21, 2013 5:32:55 PM UTC-5, Ellison Marks wrote: It's not that bad performance wise. Hiera should only lode the applicable yaml files. If (god forbid) you had one yaml file per host and had thousands of hosts, hiera should still only load two files, the host's yaml file and the common yaml file. The only thing that would be bad is manually maintaining all the yaml files :) As to the multiple parameters, it's also not that bad. You could format the parameters as an array and seperate them later, like this: NodeB.yaml --- classes: - b 'classB::params': - 'Puppet-Hiera' - 'Puppet-Hiera' - 'Puppet-Hiera' - 'Puppet-Hiera' class classB ($params = hiera('classB::params', '')) { $param1=$params[0] $param2=$params[1] $param3=$params[2] $param4=$params[3] but it's not that much better. The real trick is in using create resources correctly. You want to have a 3 depth array in hiera. top is the name you will look up with the hiera() call. Second level is the names of the resources you want to create. For example, if you were creating users, this level could have 'john' and 'jane'. Third level is the parameters for the individual resource. In this example, below john could be {'uid'=501, 'group'=john} and below jane could be {'uid'=502, 'group'=jane} userhash: john: uid: 501 group: john jane: uid: 502 group: jane then you would say $userhash=hiera('userhash') create_resources(user, $userhash) So if you can structure your class in a way that supports that flow, it can be really good. On Thursday, February 21, 2013 12:27:30 PM UTC-8, Sai_Emc wrote: That's ok Mark. I kind of remember that from documentation. When we use above approach puppet need to make multiple hiera() calls to get resources specific to a class. I mean a class with say 4 arguments, puppet need to make a multiple calls to get all the parameters. NodeB.yaml --- classes: - b 'classB::param1': 'Puppet-Hiera' 'classB::param2': 'Puppet-Hiera' 'classB::param3': 'Puppet-Hiera' 'classB::param4': 'Puppet-Hiera' If we have thousands of nodes we might see any performance issues with array approach? I might be totally wrong on this. The same if I have declared as Hash then from puppet that is just one call, but it might look all defined hierarchies. So if we do use hiera_hash then without using create_resources() is there any other method I can include class definitions. Thank you. Regards Sai. EMC On Thursday, February 21, 2013 3:01:54 PM UTC-5, Ellison Marks wrote: Ah, sorry, my mistake, mised the version. That line would have to be class classB ($param1 = hiera('classB::param1', '')) { with the hiera call in the definition. Sorry about that :P On Thursday, February 21, 2013 11:57:24 AM UTC-8, Sai_Emc wrote: Mark, Thanks for the quick reply. This uses the auto lookup of parameters. It will perform a hiera search for 'classB::param1'. -- Auto lookup feature what you mentioned is in PE 2.7? I remember reading as 3.0 feature. Regards Sai. EMC On Thursday, February 21, 2013 2:32:10 PM UTC-5, Ellison Marks wrote: quick definitions first: hiera() gets a value from the backend. stops searching after it finds a value. the value can be any data type. hiera_array() gets multiple values from the backend, combining them into one large array as possible. hiera_hash() gets multiple values from the backend, combining them into one large hash as possible. hiera_include() calls hiera_array() and then includes each classname returned. Ok, so hiera_include will look in the backend for a variable named in the call, in your case 'classesA'. this should contain an array of class names to include. As your hierarchy apparently doesn't contain the variable 'classesA', this explains the second error you are getting. You also didn't include the variable 'classesH' in nodeA.yaml, so that might be the cause of the failure there. create_resources is also not used on classes, just types or defines. Generally, for hiera_include, it should look sort of like this. class
[Puppet Users] Re: puppet could'nt find hiera even when hiera gem is installed
Tried /opt/puppet/bin/gem , no use puppet is still failing with errors err: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not autoload hiera_include: no such file to load -- /opt/puppet/lib/site_ruby/1.8/puppet/parser/functions/hiera_include.rb at /etc/puppetlabs/puppet/environments/development/manifests/site.pp:46 I can see gem -list --local shows hiera gems installed. /opt/puppet/bin$ /opt/puppet/bin/gem list --local *** LOCAL GEMS *** activerecord (2.3.14) activesupport (2.3.14) ar-extensions (0.9.5) builder (3.0.0) dalli (1.1.2) excon (0.14.1) fog (1.5.0) formatador (0.2.0) guid (0.1.1) hiera (1.1.2) hiera-puppet (1.0.0) Regards Sai. EMC On Friday, February 22, 2013 3:07:41 PM UTC-5, llowder wrote: On Friday, February 22, 2013 2:03:30 PM UTC-6, Sai_Emc wrote: Hiera was properly working in my environment. But puppet was looking at old version even when I have the latest hiera gem installed. So I could'nt use json backend. But puppet is not looking at my latest hiera gem. Not sure when went wrong here. Scenario: I have installed hiera couple of months back. So the gem was installed under /opt/puppet/lib/gems/1.8/gems/hiera-0.3.0 /opt/puppet/lib/gems/1.8/gems/hiera-puppet-0.3.0 Later when I updated to new version of hiera then it installed (via gem install) under /opt/puppet/lib/gems/1.8/gems/hiera-1.1.1 /opt/puppet/lib/gems/1.8/gems/hiera-puppet-1.0.0 Puppet was always using the hiera under /opt/puppet/lib/gems/1.8/gems/, so I was unable to use new features of hiera I have uninstalled hiera-0.3.0 manually using gem sudo gem uninstall --install-dir /opt/puppet/lib/gems/1.8/ hiera Then Puppet failed to find hiera() function, so its always looking under /opt/puppet/lib/gems/1.8/gems. Later I installed hiera using gem and explicitly specified to install under /opt/puppet/lib/gems/1.8/gems Now puppet cannot even find hiera() err: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not autoload hiera_include: no such file to load -- /opt/puppet/lib/site_ruby/1.8/puppet/parser/functions/hiera_include.rb at /etc/puppetlabs/puppet/environments/development/manifests/site.pp:46 on node Looks like some thing wrong with my gem path or my puppet load path is not. Any idea what went wrong here? Using Ubuntu12.04LTS, PE 2.7, Hiera1.2 Any help greatly appreciated. Try sudo /opt/puppet/bin/gem install hiera I'm not a PE user, but I think that is the right path. Regards Sai. EMC -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
[Puppet Users] Puppet-Hiera: hiera_include and hiera_hash behaviour
I am looking for few clarifications on puppet-hiera integration. Trying to move away completly from using site.pp. For that I started exploring Hiera. End of the day I want an external system prepare yaml files automatucally based on user requests. Environment: Ubuntu12.04, PE 2.7, Hiera 1.1.2 EX: class classA { notice(ClassA) } class classB ($param1 = '') { notice (ClassB: ParamValue $param1) } Now I am want to include these two classes into two different nodes, so prepared two yaml files hiera.yaml --- :hierarchy: - %{::clientcert} - common :backends: - yaml :yaml: :datadir: '/etc/puppetlabs/puppet/hieradata' NodeA.yaml --- emcutil::a: - a NodeB.yaml --- classesH: emcutil::b: param1: 'Puppet-Hiera' As I have classes as array and hash, so added below code in site.pp default section so that I can include hash and arrays. node default { hiera_include('classesA','') $param_packagesH = hiera_hash('classesH') create_resources('class',$param_classesH) } } This approach does not work. On NodeA following error: err: Could not retrieve catalog from remote server: Error 400 on SERVER: undefined method `empty?' for nil:NilClass at /etc/puppetlabs/puppet/environments/development/manifests/site.pp:48 on node On NodeB following error: err: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find data item classesA in any Hiera data file and no default supplied at /etc/puppetlabs/puppet/environments/development/manifests/site.pp:46 on node What I am doing here is valid? If we are using hiera_include or hiera_hash all the node yaml files should have all the targets and the target returns not null values? Do we have alternatives other than using hiera, hiera_include and hiera_hash? PE 2.7 do we need to do any configuration for Hiera, apart from puppet-hiera package. Specifically related to these two attributes node_terminus, external_nodes? With Hiera we can move away from site.pp completly. My understanding is correct on Hiera? Any help on this greatly appreciated. Sai. EMC Corporation. -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
[Puppet Users] Re: Puppet-Hiera: hiera_include and hiera_hash behaviour
Mark, Thanks for the quick reply. This uses the auto lookup of parameters. It will perform a hiera search for 'classB::param1'. -- Auto lookup feature what you mentioned is in PE 2.7? I remember reading as 3.0 feature. Regards Sai. EMC On Thursday, February 21, 2013 2:32:10 PM UTC-5, Ellison Marks wrote: quick definitions first: hiera() gets a value from the backend. stops searching after it finds a value. the value can be any data type. hiera_array() gets multiple values from the backend, combining them into one large array as possible. hiera_hash() gets multiple values from the backend, combining them into one large hash as possible. hiera_include() calls hiera_array() and then includes each classname returned. Ok, so hiera_include will look in the backend for a variable named in the call, in your case 'classesA'. this should contain an array of class names to include. As your hierarchy apparently doesn't contain the variable 'classesA', this explains the second error you are getting. You also didn't include the variable 'classesH' in nodeA.yaml, so that might be the cause of the failure there. create_resources is also not used on classes, just types or defines. Generally, for hiera_include, it should look sort of like this. class classA { notice(ClassA) } class classB ($param1 = '') { #This uses the auto lookup of parameters. It will perform a hiera search for 'classB::param1'. notice (ClassB: ParamValue $param1) } NodeA.yaml --- classes: - a NodeB.yaml --- classes: - b 'classB::param1': 'Puppet-Hiera' node default { hiera_include('classes', []) #empty array, not empty string, which might also have been messing things up. } } On Thursday, February 21, 2013 10:55:59 AM UTC-8, Sai_Emc wrote: I am looking for few clarifications on puppet-hiera integration. Trying to move away completly from using site.pp. For that I started exploring Hiera. End of the day I want an external system prepare yaml files automatucally based on user requests. Environment: Ubuntu12.04, PE 2.7, Hiera 1.1.2 EX: class classA { notice(ClassA) } class classB ($param1 = '') { notice (ClassB: ParamValue $param1) } Now I am want to include these two classes into two different nodes, so prepared two yaml files hiera.yaml --- :hierarchy: - %{::clientcert} - common :backends: - yaml :yaml: :datadir: '/etc/puppetlabs/puppet/hieradata' NodeA.yaml --- emcutil::a: - a NodeB.yaml --- classesH: emcutil::b: param1: 'Puppet-Hiera' As I have classes as array and hash, so added below code in site.pp default section so that I can include hash and arrays. node default { hiera_include('classesA','') $param_packagesH = hiera_hash('classesH') create_resources('class',$param_classesH) } } This approach does not work. On NodeA following error: err: Could not retrieve catalog from remote server: Error 400 on SERVER: undefined method `empty?' for nil:NilClass at /etc/puppetlabs/puppet/environments/development/manifests/site.pp:48 on node On NodeB following error: err: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find data item classesA in any Hiera data file and no default supplied at /etc/puppetlabs/puppet/environments/development/manifests/site.pp:46 on node What I am doing here is valid? If we are using hiera_include or hiera_hash all the node yaml files should have all the targets and the target returns not null values? Do we have alternatives other than using hiera, hiera_include and hiera_hash? PE 2.7 do we need to do any configuration for Hiera, apart from puppet-hiera package. Specifically related to these two attributes node_terminus, external_nodes? With Hiera we can move away from site.pp completly. My understanding is correct on Hiera? Any help on this greatly appreciated. Sai. EMC Corporation. -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
[Puppet Users] Re: Puppet-Hiera: hiera_include and hiera_hash behaviour
That's ok Mark. I kind of remember that from documentation. When we use above approach puppet need to make multiple hiera() calls to get resources specific to a class. I mean a class with say 4 arguments, puppet need to make a multiple calls to get all the parameters. NodeB.yaml --- classes: - b 'classB::param1': 'Puppet-Hiera' 'classB::param2': 'Puppet-Hiera' 'classB::param3': 'Puppet-Hiera' 'classB::param4': 'Puppet-Hiera' If we have thousands of nodes we might see any performance issues with array approach? I might be totally wrong on this. The same if I have declared as Hash then from puppet that is just one call, but it might look all defined hierarchies. So if we do use hiera_hash then without using create_resources() is there any other method I can include class definitions. Thank you. Regards Sai. EMC On Thursday, February 21, 2013 3:01:54 PM UTC-5, Ellison Marks wrote: Ah, sorry, my mistake, mised the version. That line would have to be class classB ($param1 = hiera('classB::param1', '')) { with the hiera call in the definition. Sorry about that :P On Thursday, February 21, 2013 11:57:24 AM UTC-8, Sai_Emc wrote: Mark, Thanks for the quick reply. This uses the auto lookup of parameters. It will perform a hiera search for 'classB::param1'. -- Auto lookup feature what you mentioned is in PE 2.7? I remember reading as 3.0 feature. Regards Sai. EMC On Thursday, February 21, 2013 2:32:10 PM UTC-5, Ellison Marks wrote: quick definitions first: hiera() gets a value from the backend. stops searching after it finds a value. the value can be any data type. hiera_array() gets multiple values from the backend, combining them into one large array as possible. hiera_hash() gets multiple values from the backend, combining them into one large hash as possible. hiera_include() calls hiera_array() and then includes each classname returned. Ok, so hiera_include will look in the backend for a variable named in the call, in your case 'classesA'. this should contain an array of class names to include. As your hierarchy apparently doesn't contain the variable 'classesA', this explains the second error you are getting. You also didn't include the variable 'classesH' in nodeA.yaml, so that might be the cause of the failure there. create_resources is also not used on classes, just types or defines. Generally, for hiera_include, it should look sort of like this. class classA { notice(ClassA) } class classB ($param1 = '') { #This uses the auto lookup of parameters. It will perform a hiera search for 'classB::param1'. notice (ClassB: ParamValue $param1) } NodeA.yaml --- classes: - a NodeB.yaml --- classes: - b 'classB::param1': 'Puppet-Hiera' node default { hiera_include('classes', []) #empty array, not empty string, which might also have been messing things up. } } On Thursday, February 21, 2013 10:55:59 AM UTC-8, Sai_Emc wrote: I am looking for few clarifications on puppet-hiera integration. Trying to move away completly from using site.pp. For that I started exploring Hiera. End of the day I want an external system prepare yaml files automatucally based on user requests. Environment: Ubuntu12.04, PE 2.7, Hiera 1.1.2 EX: class classA { notice(ClassA) } class classB ($param1 = '') { notice (ClassB: ParamValue $param1) } Now I am want to include these two classes into two different nodes, so prepared two yaml files hiera.yaml --- :hierarchy: - %{::clientcert} - common :backends: - yaml :yaml: :datadir: '/etc/puppetlabs/puppet/hieradata' NodeA.yaml --- emcutil::a: - a NodeB.yaml --- classesH: emcutil::b: param1: 'Puppet-Hiera' As I have classes as array and hash, so added below code in site.pp default section so that I can include hash and arrays. node default { hiera_include('classesA','') $param_packagesH = hiera_hash('classesH') create_resources('class',$param_classesH) } } This approach does not work. On NodeA following error: err: Could not retrieve catalog from remote server: Error 400 on SERVER: undefined method `empty?' for nil:NilClass at /etc/puppetlabs/puppet/environments/development/manifests/site.pp:48 on node On NodeB following error: err: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find data item classesA in any Hiera data file and no default supplied at /etc/puppetlabs/puppet/environments/development/manifests/site.pp:46 on node What I am doing here is valid? If we are using hiera_include or hiera_hash all the node yaml files should have all the targets and the target returns not null values? Do we have alternatives other than using hiera, hiera_include and hiera_hash? PE 2.7 do we need to do any configuration for Hiera, apart from puppet-hiera package. Specifically related to these two attributes node_terminus
[Puppet Users] Re: Puppet-Hiera: hiera_include and hiera_hash behaviour
Wonderful...This is cool. As you said, maintaining thousands yaml files manually might be difficlut. I have to automate this process to accept requests from an external system about which node needs which resources. So I might use json over yaml, because at this point I dont know my external system can do yaml. Any idea json backend supported in 2.7?. I saw in the documentation but not sure supported in 2.7 or not. Once again thank you very much. Regards Sai. EMC On Thursday, February 21, 2013 5:32:55 PM UTC-5, Ellison Marks wrote: It's not that bad performance wise. Hiera should only lode the applicable yaml files. If (god forbid) you had one yaml file per host and had thousands of hosts, hiera should still only load two files, the host's yaml file and the common yaml file. The only thing that would be bad is manually maintaining all the yaml files :) As to the multiple parameters, it's also not that bad. You could format the parameters as an array and seperate them later, like this: NodeB.yaml --- classes: - b 'classB::params': - 'Puppet-Hiera' - 'Puppet-Hiera' - 'Puppet-Hiera' - 'Puppet-Hiera' class classB ($params = hiera('classB::params', '')) { $param1=$params[0] $param2=$params[1] $param3=$params[2] $param4=$params[3] but it's not that much better. The real trick is in using create resources correctly. You want to have a 3 depth array in hiera. top is the name you will look up with the hiera() call. Second level is the names of the resources you want to create. For example, if you were creating users, this level could have 'john' and 'jane'. Third level is the parameters for the individual resource. In this example, below john could be {'uid'=501, 'group'=john} and below jane could be {'uid'=502, 'group'=jane} userhash: john: uid: 501 group: john jane: uid: 502 group: jane then you would say $userhash=hiera('userhash') create_resources(user, $userhash) So if you can structure your class in a way that supports that flow, it can be really good. On Thursday, February 21, 2013 12:27:30 PM UTC-8, Sai_Emc wrote: That's ok Mark. I kind of remember that from documentation. When we use above approach puppet need to make multiple hiera() calls to get resources specific to a class. I mean a class with say 4 arguments, puppet need to make a multiple calls to get all the parameters. NodeB.yaml --- classes: - b 'classB::param1': 'Puppet-Hiera' 'classB::param2': 'Puppet-Hiera' 'classB::param3': 'Puppet-Hiera' 'classB::param4': 'Puppet-Hiera' If we have thousands of nodes we might see any performance issues with array approach? I might be totally wrong on this. The same if I have declared as Hash then from puppet that is just one call, but it might look all defined hierarchies. So if we do use hiera_hash then without using create_resources() is there any other method I can include class definitions. Thank you. Regards Sai. EMC On Thursday, February 21, 2013 3:01:54 PM UTC-5, Ellison Marks wrote: Ah, sorry, my mistake, mised the version. That line would have to be class classB ($param1 = hiera('classB::param1', '')) { with the hiera call in the definition. Sorry about that :P On Thursday, February 21, 2013 11:57:24 AM UTC-8, Sai_Emc wrote: Mark, Thanks for the quick reply. This uses the auto lookup of parameters. It will perform a hiera search for 'classB::param1'. -- Auto lookup feature what you mentioned is in PE 2.7? I remember reading as 3.0 feature. Regards Sai. EMC On Thursday, February 21, 2013 2:32:10 PM UTC-5, Ellison Marks wrote: quick definitions first: hiera() gets a value from the backend. stops searching after it finds a value. the value can be any data type. hiera_array() gets multiple values from the backend, combining them into one large array as possible. hiera_hash() gets multiple values from the backend, combining them into one large hash as possible. hiera_include() calls hiera_array() and then includes each classname returned. Ok, so hiera_include will look in the backend for a variable named in the call, in your case 'classesA'. this should contain an array of class names to include. As your hierarchy apparently doesn't contain the variable 'classesA', this explains the second error you are getting. You also didn't include the variable 'classesH' in nodeA.yaml, so that might be the cause of the failure there. create_resources is also not used on classes, just types or defines. Generally, for hiera_include, it should look sort of like this. class classA { notice(ClassA) } class classB ($param1 = '') { #This uses the auto lookup of parameters. It will perform a hiera search for 'classB::param1'. notice (ClassB: ParamValue $param1) } NodeA.yaml --- classes: - a NodeB.yaml --- classes: - b 'classB::param1': 'Puppet-Hiera' node