hiera-http icon indicating copy to clipboard operation
hiera-http copied to clipboard

PE 2015 support trick

Open bryanandrews opened this issue 8 years ago • 8 comments

Here is what I had to do to get this working in PE 2015.2

gem install lookup_http
/opt/puppetlabs/puppet/bin/gem install hiera-http
/opt/puppetlabs/puppet/bin/gem install lookup_http
# ugly part
cp /usr/lib/ruby/gems/1.8/gems/lookup_http-1.0.0/lib/lookup_http.rb /opt/puppetlabs/puppet/lib/ruby/vendor_ruby

the gem install at /opt/puppetlabs/puppet/bin/gem did not resolve the issue. I had to manually copy the file into /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/ which isn't a good solution but it works

bryanandrews avatar Oct 27 '15 15:10 bryanandrews

So you installed both Gems using /opt/puppetlabs/puppet/bin/gem and lookup_http instaleld into /usr/lib/ruby?

crayfishx avatar Oct 28 '15 10:10 crayfishx

lookup_http was installed with /opt/puppetlabs/puppet/bin/gem but I don't know exactly where it was placed in the /opt/puppetlabs path. puppetserver couldn't find it on hiera lookups though. After I manually copied it into /opt/puppetlabs/puppet/lib/ruby/vendor_ruby it instantly started working.

The rb file copied from /usr/lib/ruby/gems was from the /usr/bin/gem install. The problem seems to be puppet's vendor gem install didn't install lookup_http.rb in a path PE hiera could use. It is located at "/opt/puppetlabs/puppet/lib/ruby/gems/2.1.0/gems/lookup_http-1.0.0/lib/lookup_http.rb" but hiera isn't picking that up.

On Wed, Oct 28, 2015 at 3:05 AM, Craig Dunn [email protected] wrote:

So you installed both Gems using /opt/puppetlabs/puppet/bin/gem and lookup_http instaleld into /usr/lib/ruby?

— Reply to this email directly or view it on GitHub https://github.com/crayfishx/hiera-http/issues/36#issuecomment-151788682 .

Thank you, Bryan Andrews DevOps

[image: New Website. 100% Mobile Friendly. Same Trusted Solutions. www.ifactorinc.com] http://www.ifactorinc.com/

bryanandrews avatar Oct 28 '15 15:10 bryanandrews

The /opt/puppetlabs/puppet/bin/gem installs gems for the puppet agent. I believe you need to use:

/opt/puppet/bin/puppetserver gem install hiera-http

to install gems into the puppetserver.

jbcraig avatar Oct 28 '15 15:10 jbcraig

I'm running 2015.2.0 and these are the only gem's I have:

[root@puppet: bandrews]# find /opt -name gem
/opt/puppetlabs/puppet/bin/gem
/opt/puppetlabs/server/apps/puppetserver/cli/apps/gem
[root@puppet: bandrews]#
[root@puppet: bandrews]#
/opt/puppetlabs/server/apps/puppetserver/cli/apps/gem help
/opt/puppetlabs/server/apps/puppetserver/cli/apps/gem: line 3: : command
not found

It looks like it needs $JAVA_BIN set and that isn't set up in my env. Setting it didn't help though.

[root@puppet: bandrews]# export JAVA_BIN=`which java`
[root@puppet: bandrews]# $JAVA_BIN -help
Usage: java [-options] class [args...]
           (to execute a class)
   or  java [-options] -jar jarfile [args...]
           (to execute a jar file)
<-- cut -->
[root@puppet: bandrews]#
/opt/puppetlabs/server/apps/puppetserver/cli/apps/gem help
Exception in thread "main" java.lang.NoClassDefFoundError: clojure/main
Caused by: java.lang.ClassNotFoundException: clojure.main
        at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
Could not find the main class: clojure.main. Program will exit.

I have a ticket opened with Puppet Labs support but they only support YAML and JSON backends.

On Wed, Oct 28, 2015 at 8:35 AM, jbcraig [email protected] wrote:

The /opt/puppetlabs/puppet/bin/gem installs gems for the puppet agent. I believe you need to use:

/opt/puppet/bin/puppetserver gem install hiera-http

to install gems into the puppetserver.

— Reply to this email directly or view it on GitHub https://github.com/crayfishx/hiera-http/issues/36#issuecomment-151884787 .

Thank you, Bryan Andrews DevOps

[image: New Website. 100% Mobile Friendly. Same Trusted Solutions. www.ifactorinc.com] http://www.ifactorinc.com/

bryanandrews avatar Oct 28 '15 15:10 bryanandrews

I just copied your example and that worked. I think you're right but since I already got it working with a manual copy I can't verify but I bet that was it.

bryanandrews avatar Oct 28 '15 15:10 bryanandrews

I'm certainly a beginner with hiera and puppet, but this does not seem to be the "usual" case for hiera backend installation. If that's the case, could be please update the README.md file to reflect this?

luksi1 avatar Jan 12 '16 13:01 luksi1

I was able to install using the standard installation from a PE 2015 I had on a vagrant box. Will we be closing the legacy issues?

andrewpsp avatar Apr 24 '17 04:04 andrewpsp

@andrewpsp only those that are resolved - I'll continue to support the 2.x versions of hiera-http probably until Puppet 4.0 retires for users who aren't yet on Hiera 5. I just added the labels to add some distinction between the old Hiera back end (hiera-http 2.0) and the new Hiera 5 data provider function (hiera-http 3.0)

crayfishx avatar Apr 24 '17 07:04 crayfishx