Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PE 2015 support trick #36

Open
bryanandrews opened this issue Oct 27, 2015 · 8 comments
Open

PE 2015 support trick #36

bryanandrews opened this issue Oct 27, 2015 · 8 comments

Comments

@bryanandrews
Copy link

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

@crayfishx
Copy link
Owner

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

@bryanandrews
Copy link
Author

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 notifications@github.com
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
#36 (comment)
.

Thank you,
Bryan Andrews
DevOps

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

@jbcraig
Copy link

jbcraig commented Oct 28, 2015

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.

@bryanandrews
Copy link
Author

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 notifications@github.com 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
#36 (comment)
.

Thank you,
Bryan Andrews
DevOps

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

@bryanandrews
Copy link
Author

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.

@luksi1
Copy link

luksi1 commented Jan 12, 2016

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?

@andrewpsp
Copy link

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?

@crayfishx
Copy link
Owner

@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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants