Ruby issue for installing "google-api-client" gem

asked 2016-10-04 03:13:35 -0500

updated 2016-10-04 14:45:19 -0500

DarylW gravatar image

Issue:

Unable to install required gems (google-api-client) to use custom resource modules. we require some way to handle the ruby issue for installing "google-api-client" gem.

Version details

            Operating System : Ubuntu 16.04

“ sudo /opt/puppetlabs/bin/puppetserver ruby –v “ 

jruby 1.7.26 (1.9.3p551) 2016-08-26 69763b8 on OpenJDK 64-Bit Server VM 1.8.0_91-8u91-b14-   3ubuntu1~16.04.1-b14 +jit [linux-amd64]

“ puppet –V ”

4.7.0

            “ puppetserver –v ”

                             2.6.0

Environment:

The below are the steps to install/configure puppet server/agent.

# Puppet -4.7
####################

# config directory location -
# ~/.puppetlabs/etc/puppet

# Puppet-Server (2.6)
#######################

wget https://apt.puppetlabs.com/puppetlabs-release-pc1-xenial.deb
sudo dpkg -i puppetlabs-release-pc1-xenial.deb
sudo apt update
sudo apt-get install puppetserver

# master settings
##################

# cat ~/.puppetlabs/etc/puppet/puppet.conf
[main]
certname = puppet4-server-magento.c.graphite-development.internal
server = puppet4-server-magento.c.graphite-development.internal
environment = production
runinterval = 1h
strict_variables = true
autosign = ~/.puppetlabs/etc/puppet

[master]
reports = puppetdb
storeconfigs_backend = puppetdb
storeconfigs = true
environment_timeout = unlimited
# EOF

# cat ~/.puppetlabs/etc/puppet/autosign.conf
*.c.graphite-development.internal
#EOF

service puppetserver start


# Puppet-Agent
###############

wget https://apt.puppetlabs.com/puppetlabs-release-pc1-xenial.deb
sudo dpkg -i puppetlabs-release-pc1-xenial.deb
sudo apt update
sudo apt-get -y --force-yes install puppet-agent

# cat ~/.puppetlabs/etc/puppet/puppet.conf
[main]
certname = puppet4-agent-magento.c.graphite-development.internal
server = puppet4-server-magento.c.graphite-development.internal
environment = production
runinterval = 1h

sudo /opt/puppetlabs/bin/puppet resource service puppet ensure=running enable=true
sudo /opt/puppetlabs/bin/puppet agent –test

###############
# We need to install the below gem in puppet server and agent
###############

sudo -i puppetserver gem install inifile googleauth google-api-client --no-ri --no-rdoc

Points to be considered:

  1. Puppet will run independent of the ruby version we are using as it will have a inbuilt ruby.

Link : https://docs.puppet.com/guides/platfo... under section “Ruby versions”

  1. The custom google resource modules that we are using will only work on ruby version 2.x as the gem ‘google-api-client’ requires the same.(as mentioned in custom resource module readme document)

  2. We will not install gems in the puppet-agent as it will only take the gems from the puppetserver.

Link: https://docs.puppet.com/puppetserver/... under section “Installing And Removing Gem”

edit retag flag offensive close merge delete

Comments

Just verifying, your main problem is that the underlying JRuby implementation being used by puppet server is 1.9.3, therefore incompatible with the gems that you require? There are other issues with how to keep the various modes of accessing said gem happy as well?

DarylW gravatar imageDarylW ( 2016-10-04 14:47:00 -0500 )edit

Also, I am wondering why it is needed on the puppet server, as opposed to the clients? Personally the only gems that I have had to directly install to my puppet-master have been for hiera backends.

DarylW gravatar imageDarylW ( 2016-10-04 14:49:57 -0500 )edit

Thank you Dary for your comments. I will update you my concerns soon.

PenchalNaidu gravatar imagePenchalNaidu ( 2016-10-05 01:49:53 -0500 )edit