Re: [Puppet Users] Generate an array from PuppetDB
On Thu, Jul 16, 2015 at 06:41:26AM -0700, Joao Morais wrote: Hello list. I'm trying to use PuppetDB to link a webserver cluster to an EJB cluster. Each webserver host need to reference a comma separated list of IPs provided by each EJB host Exporting and collecting resources works pretty nice but I think this isn't the better approach. I just need a variable with a hash or an array to iterate within an ERB template in order to build my list. I use this thing to grab a list of facts that eventually becomes activemq queues/topics for mcollective, your use case sounds similar enough to mine. https://forge.puppetlabs.com/dalen/puppetdbquery I tried the generate() function approach, using curl to request a JSON array. Iterating such array I can populate my template. But this approach sounds more a workaround instead a solution. Do you have another ideas to this scenario? Thanks, JM -- 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 [1]puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit [2]https://groups.google.com/d/msgid/puppet-users/9e4e9385-8c6f-4b9f-95f1-6d502baf0048%40googlegroups.com. For more options, visit [3]https://groups.google.com/d/optout. References Visible links 1. mailto:puppet-users+unsubscr...@googlegroups.com 2. https://groups.google.com/d/msgid/puppet-users/9e4e9385-8c6f-4b9f-95f1-6d502baf0048%40googlegroups.com?utm_medium=emailutm_source=footer 3. https://groups.google.com/d/optout -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/20150716174609.GA20939%40iniquitous.heresiarch.ca. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] Possible to prevent submission to PuppetDB on certain runs
The problem is we want regular runs to submit storeconfigs, with special runs disabling certain functionality (via overridden facts). In our case our application orchestration module uses exported resources and resource collection heavily. Having our puppet masters submit a catalog to puppetdb without those would cause all kinds of issues. So what I tried, and what does not seem to work, is to duplicate the vhost, change the port and rack config.ru, and copy the existing rack config to match the new vhost. I've then tried to disable storeconfigs but that does not seem to work. The puppet.conf seems to take precedence. On Sunday, July 12, 2015 at 7:46:22 PM UTC-6, Ken Barber wrote: I have the need to run puppet in a 'stripped down' state, essentially turning off a large portion of an orchestration module. The problem occurs when puppetdb receives a catalog that does not have any of the exported resources that the orchestration module would generate. This obviously wreaks havoc on the system. I need a way to do puppet runs with storeconfigs turned off or otherwise gimped. I've tried modifying the config.ru adding ARGV --storeconfigs false but this does not seem to work as I thought it ought to. I tried to follow https://docs.puppetlabs.com/puppet/latest/reference/config_about_settings.html#settings-can-be-set-on-the-command-line Hmm, why focus on command line args for this? You can just disable it in your puppet.conf: http://docs.puppetlabs.com/puppetdb/3.0/connect_puppet_master.html#edit-puppetconf ie. storeconfigs = false in the [master] section. ken. -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/3ed65fb1-291d-40d3-9c69-0941d5490d61%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[Puppet Users] Re: how to export path in bashrc via puppet script
On Thursday, July 16, 2015 at 11:55:07 PM UTC+5:30, Vince Skahan wrote: On Thursday, July 16, 2015 at 9:58:53 AM UTC-7, ayy...@orzota.com wrote: exec { file1: command = /bin/echo export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk.x86_64; /home/haas/.bashrc, } } try single quoting the inner or outer pair of quotes ? Thanks I will try. -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/a746200a-05d9-4f2b-84c9-48f6117fc210%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[Puppet Users] Re: Keeping a directory clean at top level
I have this same need. In my case it's yum repo files that I want to ensure are ONLY what puppet manages (we occasional haven brazen users drop repo's on boxes, and cause big headaches down that road). Our environment is complex enough that repo's don't come from a single file, but from disparate modules and classes. When I tell puppet to manage /etc/yum.repos.d/ with purge = true, it seems to remove every repo, then re-add them later in its run. -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/a6a78d34-4d2b-49d7-8a91-d47cfa61e54c%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] Centos 7 facter 2 issue
On Wed, Jul 15, 2015 at 4:51 PM, Phil Manuel flar...@gmail.com wrote: Hi, If I do a clean install of CentOS 7 with facter and puppet, my puppet fails with puppet agent -t Info: Retrieving pluginfacts Info: Retrieving plugin Error: Could not retrieve local facts: undefined method `hostname' for Facter:Module Error: Failed to apply catalog: Could not retrieve local facts: undefined method `hostname' for Facter:Module It sounds like you're using a module with a custom fact that, on CentOS 7 at least, uses a syntax that was removed in Facter 2.x and later. Facter 2.x (and Facter 3.x) do not support querying facts via the method syntax on the Facter module itself. e.g. `Facter.hostname` is not supported in 2.x+; instead, use `Facter.value(:hostname)`. Specify `--trace` to puppet and see if you can determine the offending module in the trace back. rpm -qa puppet puppet-3.8.1-1.el7.noarch rpm -qa facter facter-2.4.4-1.el7.x86_64 If i run facter hostname it works fine. If I run puppet facts find hostname Error: Could not call 'find' on 'facts': undefined method `hostname' for Facter:Module Error: Could not call 'find' on 'facts': undefined method `hostname' for Facter:Module Error: Try 'puppet help facts find' for usage If I downgrade facter to 1.7.x then it works fine. If I perform the same process on Fedora 22 which has rpm -qa facter facter-2.4.1-1.fc22.x86_64 rpm -qa puppet puppet-4.1.0-1.fc22.noarch It works fine. Has anyone got any suggestions ? Thanks Phil. -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/86d2bf02-7152-4a9a-bd25-9645fbaab7d2%40googlegroups.com https://groups.google.com/d/msgid/puppet-users/86d2bf02-7152-4a9a-bd25-9645fbaab7d2%40googlegroups.com?utm_medium=emailutm_source=footer . For more options, visit https://groups.google.com/d/optout. -- *Join us at **PuppetConf 2015, October 5-9 in Portland, OR - *www. http://www.google.com/url?q=http%3A%2F%2Fwww.sa=Dsntz=1usg=AFQjCNEnS7itqgvQV3E4Se1fu4Um_UapSw 2015.puppetconf.com http://www.google.com/url?q=http%3A%2F%2F2015.puppetconf.comsa=Dsntz=1usg=AFQjCNE1uQL4Sh23Vr-XkPLa4xfNcoXSog *Register early to save 40%!* -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CACZQQfPUKM8gFS%2B_ikBwSy6ccWhNMz9jSh%2BM_a5-G7GWiOkx6g%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] Modul postgresql cannot handle negative value when writing config files
Hi, thanks for your feedback. I provided some more information, unfortunately the suggested quoting did not work. installed software ## facter 2.4.1-1 hiera 1.3.4-1 puppet 3.7.5-1 puppet-common 3.7.5-1 scenarios # 1 - values in quotes postgresql::server::config_entry { 'max_standby_archive_delay': value = '-1'} result -- postgresql.conf contains value in quotes: ... max_standby_streaming_delay = '-1' ... 2 - values without quotes = postgresql::server::config_entry { 'max_standby_archive_delay': value = -1} result -- puppet run fails: Error: /Stage[main]/Main/Node[puppet02-node1]/Postgresql::Server::Config_entry[max_standby_archive_delay]/Postgresql_conf[max_standby_archive_delay]: Could not evaluate: undefined method `match' for -1:Fixnum 3 - alternative quotes == postgresql::server::config_entry { 'max_standby_archive_delay': 'value = -1'} result -- puppet run fails: Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not parse for environment production: Syntax error at 'value = -1'; expected '}' at /etc/puppet/environments/production/manifests/nodes/puppet02-node1.pp:16 on node puppet02-node1 Warning: Not using cache on failed catalog Error: Could not retrieve catalog; skipping run 4 - alternative quotes2 === postgresql::server::config_entry { 'max_standby_archive_delay': `value = -1`} result -- puppet run fails: Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not parse for environment production: Could not match `value at /etc/puppet/environments/production/manifests/nodes/puppet02-node1.pp:16 on node puppet02-node1 Warning: Not using cache on failed catalog Error: Could not retrieve catalog; skipping run -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/af5f4724-a599-4151-a3c4-adb0488451a2%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[Puppet Users] Windows Unzip Remote Zip file
For the benefit of others, I contacted the maintainer of the reidmv/unzip module and this was his (very helpful) response :- Hi Fraser, The requirement that the file be local is just a constraint of how the unzip module works right now. This is a very simple module. In practice, that means that if your file is remote you either need to use something like lwf/remote_file to first ensure that a local copy exists, or alternatively you could use a larger more complicated module such as nanliu/archive, which provides a larger more complex type that can directly retrieve and unzip remote files. Example using reidmv/unzip and lwf/remote_file together: remote_file { 'jboss-native.zip': ensure = present, path= 'C:/jboss/jboss-native-2.0.10-windows-x64-ssl.zip', source = 'http://downloads.jboss.org/jbossnative/2.0.10.GA/jboss-native-2.0.10-windows-x64-ssl.zip', require = File['C:/jboss/jboss-as-7.1.1.Final'], } - unzip { 'jboss-native': source = 'C:/jboss/jboss-native-2.0.10-windows-x64-ssl.zip', destination = 'C:/jboss/jboss-as-7.1.1.Final', creates = 'C:/jboss/jboss-as-7.1.1.Final/bin/jbosssvc.exe', } Example using nanliu/archive: archive { 'jboss-native': ensure= present, extract = true, extract_path = 'C:/jboss/jboss-as-7.1.1.Final', source= 'http://downloads.jboss.org/jbossnative/2.0.10.GA/jboss-native-2.0.10-windows-x64-ssl.zip', creates = 'C:/jboss/jboss-as-7.1.1.Final/bin/jbosssvc.exe', cleanup = true, } I don't typically use archive myself since it's a little bit more heavyweight and when I used it last it required 7zip and some ruby gems installed to operate correctly but I like to mention it in case it works for people. unzip itself could likely be extended to be able to use remote sources if someone were to upgrade the powershell snippet that is used to perform the extraction. I don'tnticipate adding that anytime soon myself but pull requests definitely welcome! :-) Hope that helps, ~Reid - Show quoted text - -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/50639b6c-9db2-4ba4-9174-5be41737cca2%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[Puppet Users] Generate an array from PuppetDB
Hello list. I'm trying to use PuppetDB to link a webserver cluster to an EJB cluster. Each webserver host need to reference a comma separated list of IPs provided by each EJB host Exporting and collecting resources works pretty nice but I think this isn't the better approach. I just need a variable with a hash or an array to iterate within an ERB template in order to build my list. I tried the generate() function approach, using curl to request a JSON array. Iterating such array I can populate my template. But this approach sounds more a workaround instead a solution. Do you have another ideas to this scenario? Thanks, JM -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/9e4e9385-8c6f-4b9f-95f1-6d502baf0048%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[Puppet Users] how to export path in bashrc via puppet script
exec { file1: command = /bin/echo export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk.x86_64; /home/haas/.bashrc, } } i try to added java path. facing issue. Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Syntax error at 'export'; expected '}' at /etc/puppet/modules/a/manifests/init.pp:3 on node ip-10-61-204-93.ec2.internal Warning: Not using cache on failed catalog Error: Could not retrieve catalog; skipping run Thanks for your commands. Thanks, Ayyanar -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/1bb13016-2f01-499d-b756-d8e2ecaa2341%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[Puppet Users] how to export path in bashrc via puppet script
exec { file1: command = /bin/echo export JAVA_HOME=/usr/lib/jvm/java-1. 7.0-openjdk.x86_64; /home/haas/.bashrc, } } i try to added java path. facing issue. Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Syntax error at 'export'; expected '}' at /etc/puppet/modules/a/manifests/init.pp:3 on node ip-10-61-204-93.ec2.internal Warning: Not using cache on failed catalog Error: Could not retrieve catalog; skipping run Thanks for your commands. Thanks, Ayyanar -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/cc13a7e5-c4ce-449f-a077-b1a66810f12b%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[Puppet Users] How to append a file in bashrc file.
cd $HOME/a.sh$HOME/.bashrc how to append a.sh file into bashrc file. -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/48dc1ecc-d803-41ce-a637-5cbe00233621%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] Modul postgresql cannot handle negative value when writing config files
On Wed, Jul 15, 2015 at 11:36 PM rbrinkm...@nicos-ag.com wrote: Hi, thanks for your feedback. I provided some more information, unfortunately the suggested quoting did not work. Oh, I wouldn't recommend quoting numbers; just strings. installed software ## facter 2.4.1-1 hiera 1.3.4-1 puppet 3.7.5-1 puppet-common 3.7.5-1 scenarios # 1 - values in quotes postgresql::server::config_entry { 'max_standby_archive_delay': value = '-1'} result -- postgresql.conf contains value in quotes: ... max_standby_streaming_delay = '-1' ... 2 - values without quotes = postgresql::server::config_entry { 'max_standby_archive_delay': value = -1} result -- puppet run fails: Error: /Stage[main]/Main/Node[puppet02-node1]/Postgresql::Server::Config_entry[max_standby_archive_delay]/Postgresql_conf[max_standby_archive_delay]: Could not evaluate: undefined method `match' for -1:Fixnum Thanks for this. It's probably coming from this line https://github.com/puppetlabs/puppetlabs-postgresql/blob/master/lib/puppet/provider/postgresql_conf/parsed.rb#L26 but without --trace I can't be sure. Most likely that can just be moved into the conditional logic when the provider checks for Fixnum and it could work. 3 - alternative quotes == postgresql::server::config_entry { 'max_standby_archive_delay': 'value = -1'} result -- puppet run fails: Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not parse for environment production: Syntax error at 'value = -1'; expected '}' at /etc/puppet/environments/production/manifests/nodes/puppet02-node1.pp:16 on node puppet02-node1 Warning: Not using cache on failed catalog Error: Could not retrieve catalog; skipping run 4 - alternative quotes2 === postgresql::server::config_entry { 'max_standby_archive_delay': `value = -1`} result -- puppet run fails: Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not parse for environment production: Could not match `value at /etc/puppet/environments/production/manifests/nodes/puppet02-node1.pp:16 on node puppet02-node1 Warning: Not using cache on failed catalog Error: Could not retrieve catalog; skipping run -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/af5f4724-a599-4151-a3c4-adb0488451a2%40googlegroups.com https://groups.google.com/d/msgid/puppet-users/af5f4724-a599-4151-a3c4-adb0488451a2%40googlegroups.com?utm_medium=emailutm_source=footer . For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAJaQvGAXduqsnCQUT3xriFr2JAwrh%3DHOeU0MTNwhTnqHhh1q-g%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
[Puppet Users] Error: undefined method `' for :undef:Symbol at line of one of my modules
Hi folks, First off, let me underline that I'm completely new to Puppet. I'm an intermediate Chef user but just changed jobs, and the new place is a Puppet shop and I've never touched Puppet in my life. I have not had time to acclimatize to it at all, but today my coworker asked me to make some changes to running servers. Gotta start somewhere. My being a newbie also means I'm not sure what information to give you but I'll try my best. In addition, we use Vagrant for local testing before pushing to servers, this is where the trouble occurs -- during Vagrant provisioning. We're using this box: http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210.box (CentOS 6.4) As far as I can tell, it ships with Puppet 3.1.1. The host computer -- my laptop -- is OS X 10.10.4, if it matters, and I'm using VirtualBox 5.0. Also using the following Vagrant plugins: vagrant-cachier 1.2.1, vagrant-librarian-puppet 0.7.1 and vagrant-share 1.1.3. Right now I can't use a newer version of the librarian plugin because it causes another, completely unrelated error. 0.7.1 is the version my coworker uses. During the Puppet run, I get the following error: == centos6: Error: undefined method `' for :undef:Symbol at /tmp/vagrant-puppet/modules-0082ff7071bbf237d9411fcd54aae93c/profile/manifests/my_module.pp:29 on node foo.bar.com This is the corresponding chunk of code: if $::operatingsystemmajrelease 7 { monit::foo { $webservice: app_port= hiera(${webservice}::http_port,undef,foo/common), app_uri = hiera(${webservice}::app_uri,undef,${webservice}/common), } } else { include systemd_mon systemd_mon::register { $webservice: unit = $webservice, } } Line 29 is the first one above. We have some CentOS 7 in the infrastructure so we need to handle it differently since CentOS 7 switched to systemd, as you probably know, hence the above chunk of code. It looks good to me, and my coworker, who is much more experienced with Puppet, also sees nothing wrong with it. Of course that works on his machine, so it sounds to me like nothing is indeed wrong with the code, but rather with something on my machine, but then again, the error occurs during the Puppet run inside the VM so I'm not sure how my machine would affect it. My coworker is stumped and obviously I don't know where to start. All I could find through Google was this: https://projects.puppetlabs.com/issues/8783 But it's an ancient ticket and it doesn't look like the same problem, even though it's the same error, so I doubt this is helpful. Could anybody please suggest something to start troubleshooting this? Thanks! -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/105e47a4-cca3-42e7-876c-dcaee2685b77%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] Error: undefined method `' for :undef:Symbol at line of one of my modules
On Thu, Jul 16, 2015 at 11:21 AM Fabien Delpierre fabien.delpie...@gmail.com wrote: Hi folks, First off, let me underline that I'm completely new to Puppet. I'm an intermediate Chef user but just changed jobs, and the new place is a Puppet shop and I've never touched Puppet in my life. I have not had time to acclimatize to it at all, but today my coworker asked me to make some changes to running servers. Gotta start somewhere. My being a newbie also means I'm not sure what information to give you but I'll try my best. In addition, we use Vagrant for local testing before pushing to servers, this is where the trouble occurs -- during Vagrant provisioning. We're using this box: http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210.box (CentOS 6.4) As far as I can tell, it ships with Puppet 3.1.1. Ooo, old. The host computer -- my laptop -- is OS X 10.10.4, if it matters, and I'm using VirtualBox 5.0. Also using the following Vagrant plugins: vagrant-cachier 1.2.1, vagrant-librarian-puppet 0.7.1 and vagrant-share 1.1.3. Right now I can't use a newer version of the librarian plugin because it causes another, completely unrelated error. 0.7.1 is the version my coworker uses. During the Puppet run, I get the following error: == centos6: Error: undefined method `' for :undef:Symbol at /tmp/vagrant-puppet/modules-0082ff7071bbf237d9411fcd54aae93c/profile/manifests/my_module.pp:29 on node foo.bar.com This is the corresponding chunk of code: if $::operatingsystemmajrelease 7 { A minimal use case shows that if $::operatingsystemmajrelease is undef (puppet's idea of nil) then this will happen, because you can't compare undef with comparators. (I include --trace just to show it really is the puppet manifest `` and not a ruby method ``) [root@q2xuk1zrzaqpy3f ~]# puppet --version 3.1.1 [root@q2xuk1zrzaqpy3f ~]# puppet apply -e 'if $whatever 5 {}' --trace Error: undefined method `' for :undef:Symbol at line 1 on node q2xuk1zrzaqpy3f.delivery.puppetlabs.net /usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/parser/ast/comparison_operator.rb:28:in `send' /usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/parser/ast/comparison_operator.rb:28:in `evaluate' /usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/parser/ast.rb:62:in `safeevaluate' /usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/parser/ast/ifstatement.rb:20:in `evaluate' /usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/parser/ast.rb:62:in `safeevaluate' /usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/parser/ast/astarray.rb:25:in `evaluate' /usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/parser/ast/astarray.rb:20:in `each' /usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/parser/ast/astarray.rb:20:in `evaluate' /usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/parser/ast.rb:62:in `safeevaluate' /usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/resource/type.rb:136:in `evaluate_code' /usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/parser/resource.rb:81:in `evaluate' /usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/parser/compiler.rb:282:in `evaluate_main' /usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/parser/compiler.rb:96:in `compile' /usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/parser/compiler.rb:29:in `compile' /usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/indirector/catalog/compiler.rb:83:in `compile' /usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/util.rb:184:in `benchmark' /usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/indirector/catalog/compiler.rb:81:in `compile' /usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/indirector/catalog/compiler.rb:41:in `find' /usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/indirector/indirection.rb:191:in `find' /usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/application/apply.rb:204:in `main' /usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/application/apply.rb:146:in `run_command' /usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/application.rb:364:in `run' /usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/application.rb:456:in `plugin_hook' /usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/application.rb:364:in `run' /usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/util.rb:504:in `exit_on_fail' /usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/application.rb:364:in `run' /usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/util/command_line.rb:132:in `run' /usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/util/command_line.rb:86:in `execute' /usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/bin/puppet:4 Simple workaround is to check that the variable has a value before comparing it: [root@q2xuk1zrzaqpy3f ~]# puppet apply -e 'if $whatever and $whatever 5 {}' Notice: Finished catalog run in 0.20 seconds But... $operatingsystemmajrelease is totally a valid fact on centos6 and facter 1.7.6 that I get when gem installing puppet 3.1.1: [root@q2xuk1zrzaqpy3f ~]# facter --version 1.7.6 [root@q2xuk1zrzaqpy3f
[Puppet Users] Re: how to export path in bashrc via puppet script
On Thursday, July 16, 2015 at 9:58:53 AM UTC-7, ayy...@orzota.com wrote: exec { file1: command = /bin/echo export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk.x86_64; /home/haas/.bashrc, } } try single quoting the inner or outer pair of quotes ? -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/c8a1b3b8-0899-41bf-ba73-e4c8e693c4ea%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] Re: Keeping a directory clean at top level
On Thu, Jul 16, 2015 at 11:46:41AM -0700, L. Matthew Blancett wrote: I have this same need. In my case it's yum repo files that I want to ensure are ONLY what puppet manages (we occasional haven brazen users drop repo's on boxes, and cause big headaches down that road). Our environment is complex enough that repo's don't come from a single file, but from disparate modules and classes. When I tell puppet to manage /etc/yum.repos.d/ with purge = true, it seems to remove every repo, then re-add them later in its run. The yumrepos are not file resources, if I recall correctly the purging is done on files and the /etc/yum.repos.d/* are not explicitly managed as files. So the files are nuked and then the yumrepos are create and put in files for the cycle to start again. Having the same issue I stopped declaring yumrepo types and started declaring files for the contents of that directory. Everybody here is used to the repo file format and it went transparently. -- 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 [1]puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit [2]https://groups.google.com/d/msgid/puppet-users/a6a78d34-4d2b-49d7-8a91-d47cfa61e54c%40googlegroups.com. For more options, visit [3]https://groups.google.com/d/optout. References Visible links 1. mailto:puppet-users+unsubscr...@googlegroups.com 2. https://groups.google.com/d/msgid/puppet-users/a6a78d34-4d2b-49d7-8a91-d47cfa61e54c%40googlegroups.com?utm_medium=emailutm_source=footer 3. https://groups.google.com/d/optout -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/20150716185315.GA21495%40iniquitous.heresiarch.ca. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] Puppet 4.2. and latest Puppet Agent 1.2.1-x64 on Windows 2008 r2 keeps crashing with error 400: Invalid byte sequence in UTF-8
On Wed, Jul 15, 2015 at 9:08 AM, Peter Huene peter.hu...@puppetlabs.com wrote: On Wed, Jul 15, 2015 at 9:04 AM, Josh Cooper j...@puppetlabs.com wrote: On Tue, Jul 14, 2015 at 2:13 PM, mst3k gro...@gt-it.de wrote: Hi, thx for the answer - and sorry for the weird postings. I may need to create a google-account after all to submit decent requests.. But I got the logs: puppet.log - http://pastebin.com/aA6dqK24 facter.log - http://pastebin.com/f3i8Q6Y9 I believe the timezone fact is giving us trouble: timezone = Mitteleurop‰ische Sommerzeit There have been various tickets filed[1], and I thought it had finally been resolved, but perhaps not or this is a regression in native facter? This appears to be a regression in Facter 3.0.1. I've opened a ticket to track this: https://tickets.puppetlabs.com/browse/FACT-1126 Closing the loop. We've fixed this for Facter 3.0.2 and the fix will be in the next release of Puppet agent. Thanks very much for reporting this issue to us. I hope that helps. Thank you for your time! Am 14.07.2015 um 17:52 schrieb Rob Reynolds r...@puppetlabs.com: Would you mind including some logs from the agent as well? I'm looking for * facter --trace --debug facter.log 21 * puppet agent --test --debug --verbose --trace puppet.log 21 Thanks! On Mon, Jul 13, 2015 at 10:12 AM, mst3k gro...@gt-it.de wrote: Hi, I’m trying to set up a new heterogeneous environment with a Puppet 4.2. server running on a 14.04.2 Ubuntu LTS and some *nix and windows clients. Without any changes to the server (except enabling autosigning for my domain and setting the alt_dns_names for the master) I’m trying to connect from another Ubuntu and a Windows 2008 r2 client, but where the ubuntu client will connect without a problem, windows keeps getting an Error: Error 400 on Server: Invalid byte sequence in UTF-8 I searched the web for a hint and saw, that in an earlier version this could be fixed with a locale-setting in the file „config.ru“, which I don’t seem to have on a 4.2. installation. I also tried to set the apache charset to utf-8 with the charset-config file with no success. Can anybody point me to the right direction? Thank you in advance. The error-log on the server: 2015-07-13 09:48:00,273 INFO [puppet-server] Puppet Caching node for mynode.mydomain 2015-07-13 09:48:00,736 ERROR [puppet-server] Puppet invalid byte sequence in UTF-8 org/jruby/RubyString.java:6202:in `count' /opt/puppetlabs/server/apps/puppetserver/puppet-server-release.jar!/META-INF/jruby.home/lib/ruby/shared/psych/visitors/yaml_tree.rb:248:in `binary?' /opt/puppetlabs/server/apps/puppetserver/puppet-server-release.jar!/META-INF/jruby.home/lib/ruby/shared/psych/visitors/yaml_tree.rb:262:in `visit_String' /opt/puppetlabs/server/apps/puppetserver/puppet-server-release.jar!/META-INF/jruby.home/lib/ruby/shared/psych/visitors/yaml_tree.rb:128:in `accept' /opt/puppetlabs/server/apps/puppetserver/puppet-server-release.jar!/META-INF/jruby.home/lib/ruby/shared/psych/visitors/yaml_tree.rb:324:in `visit_Hash' org/jruby/RubyHash.java:1341:in `each' /opt/puppetlabs/server/apps/puppetserver/puppet-server-release.jar!/META-INF/jruby.home/lib/ruby/shared/psych/visitors/yaml_tree.rb:322:in `visit_Hash' /opt/puppetlabs/server/apps/puppetserver/puppet-server-release.jar!/META-INF/jruby.home/lib/ruby/shared/psych/visitors/yaml_tree.rb:128:in `accept' /opt/puppetlabs/server/apps/puppetserver/puppet-server-release.jar!/META-INF/jruby.home/lib/ruby/shared/psych/visitors/yaml_tree.rb:467:in `emit_coder' org/jruby/RubyHash.java:1341:in `each' /opt/puppetlabs/server/apps/puppetserver/puppet-server-release.jar!/META-INF/jruby.home/lib/ruby/shared/psych/visitors/yaml_tree.rb:465:in `emit_coder' /opt/puppetlabs/server/apps/puppetserver/puppet-server-release.jar!/META-INF/jruby.home/lib/ruby/shared/psych/visitors/yaml_tree.rb:450:in `dump_coder' /opt/puppetlabs/server/apps/puppetserver/puppet-server-release.jar!/META-INF/jruby.home/lib/ruby/shared/psych/visitors/yaml_tree.rb:126:in `accept' /opt/puppetlabs/server/apps/puppetserver/puppet-server-release.jar!/META-INF/jruby.home/lib/ruby/shared/psych/visitors/yaml_tree.rb:92:in `push' /opt/puppetlabs/server/apps/puppetserver/puppet-server-release.jar!/META-INF/jruby.home/lib/ruby/shared/psych.rb:244:in `dump' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/yaml.rb:21:in `dump' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:380:in `replace_file' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/yaml.rb:20:in `dump' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/yaml.rb:30:in `save' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/indirection.rb:276:in `save' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/node/facts.rb:21:in `save'
[Puppet Users] Unable to get the ruby-ldap gem working with Puppet 4.x
I have a fresh install of Puppet 4.2 on an Ubuntu 14.04 box: root@puppet:~# /opt/puppetlabs/bin/puppetserver -v puppetserver version: 2.1.1 We have a locally written Ruby command to do a LDAP lookup to get UIDs for our users, but with Puppet 4.2 it errors out: - Begin error - root@puppet:~# puppet agent -t Info: Retrieving pluginfacts Info: Retrieving plugin Info: Loading facts Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Internal Server Error: org.jruby.exceptions.RaiseException: (LoadError) no such file to load -- ldap Warning: Not using cache on failed catalog Error: Could not retrieve catalog; skipping run - End error - I installed the gem with: - Begin quote - root@puppet:/etc/puppetlabs/code# /opt/puppetlabs/puppet/bin/gem install ruby-ldap root@puppet:/etc/puppetlabs/code# /opt/puppetlabs/puppet/bin/gem list ruby-ldap *** LOCAL GEMS *** ruby-ldap (0.9.17) - End quote - The full back-trace is attached. The same Ruby file works with Puppet 3.8.1 on Ubuntu 12.04 with the ruby-ldap package installed (not as a gem). What am I missing? Thanks, Omen -- Omen Wild Systems Administrator Metro Cluster -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/20150717011546.GB10028%40descolada.ucdavis.edu. For more options, visit https://groups.google.com/d/optout. 2015-07-16 18:02:16,699 ERROR [p.p.ringutils] Exception while handling HTTP request org.jruby.exceptions.RaiseException: (LoadError) no such file to load -- ldap at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:1072) ~[puppet-server-release.jar:na] at RUBY.require(/opt/puppetlabs/server/apps/puppetserver/puppet-server-release.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:54) ~[na:na] at RUBY.real_function_get_campus_gecos(/etc/puppetlabs/code/environments/production/modules/ucdpuppet/lib/puppet/parser/functions/get_campus_gecos.rb:4) ~[na:na] at RUBY.function_get_campus_gecos(/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/parser/functions.rb:162) ~[na:na] at RUBY.profile(/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/profiler/around_profiler.rb:58) ~[na:na] at RUBY.profile(/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/profiler.rb:51) ~[na:na] at RUBY.function_get_campus_gecos(/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/parser/functions.rb:155) ~[na:na] at RUBY.call_function(/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/evaluator/runtime3_support.rb:281) ~[na:na] at RUBY.call_function_with_block(/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/evaluator/evaluator_impl.rb:836) ~[na:na] at RUBY.eval_CallNamedFunctionExpression(/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/evaluator/evaluator_impl.rb:816) ~[na:na] at RUBY.visit_this_1(/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/visitor.rb:67) ~[na:na] at RUBY.evaluate(/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/evaluator/evaluator_impl.rb:73) ~[na:na] at RUBY.evaluate(/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/parser/evaluating_parser.rb:57) ~[na:na] at RUBY.evaluate(/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/parser/ast/pops_bridge.rb:32) ~[na:na] at RUBY.safeevaluate(/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/parser/ast.rb:31) ~[na:na] at RUBY.set_default_parameters(/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource.rb:476) ~[na:na] at org.jruby.RubyHash.each(org/jruby/RubyHash.java:1341) ~[puppet-server-release.jar:na] at org.jruby.RubyEnumerable.collect(org/jruby/RubyEnumerable.java:759) ~[puppet-server-release.jar:na] at RUBY.set_default_parameters(/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource.rb:470) ~[na:na] at RUBY.set_resource_parameters(/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/type.rb:277) ~[na:na] at RUBY.evaluate_code(/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/type.rb:106) ~[na:na] at RUBY.evaluate(/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/parser/resource.rb:79) ~[na:na] at RUBY.evaluate_definitions(/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/parser/compiler.rb:368) ~[na:na] at RUBY.profile(/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/profiler/around_profiler.rb:58) ~[na:na] at RUBY.profile(/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/profiler.rb:51) ~[na:na] at RUBY.evaluate_definitions(/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/parser/compiler.rb:367)
Re: [Puppet Users] Generate an array from PuppetDB
Hello list. I'm trying to use PuppetDB to link a webserver cluster to an EJB cluster. Each webserver host need to reference a comma separated list of IPs provided by each EJB host Exporting and collecting resources works pretty nice but I think this isn't the better approach. I just need a variable with a hash or an array to iterate within an ERB template in order to build my list. I tried the generate() function approach, using curl to request a JSON array. Iterating such array I can populate my template. But this approach sounds more a workaround instead a solution. Do you have another ideas to this scenario? Thanks, JM Joao, Take a look at this library, authored by my friend Eric: https://github.com/dalen/puppet-puppetdbquery It provides Puppet functions for querying PDB, its syntax is a wrapper around our own PDB one, but should provide you with the tools to do queries against PDB in a more arbitrary way hopefully avoiding the need for your own curl/shell methodology. You might still need to manipulate the data you receive using other tools, but it should be a good start for what you want. If you get stuck further down the line, respond to this thread. We have plans to solidify this story, and make it closer to our core offerings but I'm wary to get into a vapourware discussion until we have something to show. For now, what I've provided is where you want to look. ken. -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAE4bNTkmEHdTw%2BdR7myJYJcAt%2B3ukkfimW8V%2BRKmdJOkWvQbdA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
[Puppet Users] Announce: PuppetDB 2.3.6 is now available!
PuppetDB 2.3.6 July 16, 2015 PuppetDB 2.3.6 Downloads Available in native package format in the release repositories at: http://yum.puppetlabs.com and http://apt.puppetlabs.com For information on how to enable the Puppet Labs repos, see: http://docs.puppetlabs.com/guides/puppetlabs_package_repositories.html#open-source-repositories Binary tarball: http://downloads.puppetlabs.com/puppetdb/ Source: http://github.com/puppetlabs/puppetdb Please report feedback via the Puppet Labs tickets site, using an affected PuppetDB version of 2.3.6: https://tickets.puppetlabs.com/browse/PDB Documentation: http://docs.puppetlabs.com/puppetdb/2.3/ Puppet module: http://forge.puppetlabs.com/puppetlabs/puppetdb PuppetDB 2.3.6 Release Notes PuppetDB 2.3.6 is a backwards-compatible bugfix release that improves the downgrade process from 3.0, adds deprecation warnings for PostgreSQL versions 9.3 and below, and fixes an issue with relationships on resource aliases in the puppetdb terminus. For more information and upgrade advice, consult the detailed release notes here: https://docs.puppetlabs.com/puppetdb/2.3/release_notes.html Contributors Andrew Roetker, Ken Barber, Nick Fagerlund, Rob Browning, Russell Mull, Wyatt Alt -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAJDiH3HBUCeeUOSqMGVPLQzCTR3c5Hs8MujmVmPKpdHW22hkqQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
[Puppet Users] Package versions in PuppetDB
Hi! I can run 'puppet resource package' on a node to get a list of installed packages and version numbers. are those version numbers available through a PuppetDB(2.3) API query? the http://localhost:8080/v3/catalogs/${NODE} call shows the desired end-state type : Package, title : libc6, parameters : { ensure : latest }, and curl -G 'http://localhost:8080/v3/events' --data-urlencode 'query=[and, [=, resource-type,Package], [=,resource-title,libc6]]' will show what's changed or failed with libc6 . can I get the current package version number through an API call? Thanks! -jer johnson -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/a47876f4-8f8d-4909-a7f0-d1491a19d35c%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.