hiera-eyaml
hiera-eyaml copied to clipboard
i dont have internet access to install hiera-eyaml
Hi,
Is there any alternate way to install hiera-eyaml because i dont have internet access to install gem install hiera-eyaml.
Please let me know
The RubyGems knowledge base article about this can help you out.
Hi,
I followed that and installed hiera-eyaml. But i am having this issue:
./eyaml encrypt -s 'hello there'
/opt/puppet/lib/ruby/1.9.1/rubygems/dependency.rb:247:in to_specs': Could not find trollop (~> 2.0) amongst [addressable-2.3.5, autoparse-0.3.3, bigdecimal-1.1.0, builder-3.0.0, deep_merge-1.0.0, excon-0.14.1, extlib- 0.9.16, faraday-0.8.8, fog-1.5.0, formatador-0.2.0, google-api-client-0.6.4, guid-0.1.1, hiera-eyaml-2.0.8, i o-console-0.3, json-1.5.5, jwt-0.1.8, launchy-2.3.0, mime-types-1.16, minitest-2.5.1, multi_json-1.8.0, multi part-post-1.2.0, net-scp-1.0.4, net-ssh-2.1.4, nokogiri-1.5.10, rack-1.4.5, rake-0.9.2.2, rbvmomi-1.3.0, rdoc -3.9.5, ruby-hmac-0.4.0, signet-0.4.5, trollop-1.16.2, uuidtools-2.1.4] (Gem::LoadError) from /opt/puppet/lib/ruby/1.9.1/rubygems/specification.rb:777:in
block in activate_dependencies'
from /opt/puppet/lib/ruby/1.9.1/rubygems/specification.rb:766:in each' from /opt/puppet/lib/ruby/1.9.1/rubygems/specification.rb:766:in
activate_dependencies'
from /opt/puppet/lib/ruby/1.9.1/rubygems/specification.rb:750:in activate' from /opt/puppet/lib/ruby/1.9.1/rubygems.rb:1232:in
gem'
from ./eyaml:22:in `
Hi,
Do i need to install rails gem too. Let me know. On the first step to install rails from internet. I dont have access to internet
Do i need to install rails gem too. Let me know. On the first step to install rails from internet.
That was an example for if someone wanted to install the rails gem.
I followed that and installed hiera-eyaml. But i am having this issue:
What are the exact commands you ran to install the hiera-eyaml gem?
/opt/puppet/bin/gem install --force --local hiera-eyaml-2.0.8.gem Successfully installed hiera-eyaml-2.0.8 1 gem installed Installing ri documentation for hiera-eyaml-2.0.8... Installing RDoc documentation for hiera-eyaml-2.0.8...
That is the only one installed
You'll need to install the dependencies. That's why the article says to run gem install --force --local *.gem
.
Hi,
It is giving me error ./gem install --force --local .gem ERROR: Could not find a valid gem '.gem' (>= 0) in any repository
The *
is necessary. Make sure you're in the folder with the gem files and then run /opt/puppet/bin/gem install --force --local *.gem
/opt/puppet/bin/gem install --force --local .gem ERROR: Could not find a valid gem '.gem' (>= 0) in any repository
I did that but still giving me error
Hi,
I did that but still giving me error
/opt/puppet/bin/gem install --force --local *.gem
Successfully installed addressable-2.3.8
Successfully installed autoparse-0.3.3
Successfully installed hiera-eyaml-2.0.8
3 gems installed
Installing ri documentation for addressable-2.3.8...
Installing ri documentation for autoparse-0.3.3...
Installing ri documentation for hiera-eyaml-2.0.8...
Installing RDoc documentation for addressable-2.3.8...
Installing RDoc documentation for autoparse-0.3.3...
Installing RDoc documentation for hiera-eyaml-2.0.8...
[root@dot-pap-che-cv1 suppalapati]# cd /opt/puppet/bin/
[root@dot-pap-che-cv1 bin]# ./eyaml encrypt -s 'hello there'
/opt/puppet/lib/ruby/1.9.1/rubygems/dependency.rb:247:in to_specs': Could not find trollop (~> 2.0) amongst [addressable-2.3.8, addressable-2.3.5, autoparse-0.3.3, bigdecimal-1.1.0, builder-3.0.0, deep_merge-1.0.0, excon-0.14.1, extlib-0.9.16, faraday-0.8.8, fog-1.5.0, formatador-0.2.0, google-api-client-0.6.4, guid-0.1.1, hiera-eyaml-2.0.8, io-console-0.3, json-1.5.5, jwt-0.1.8, launchy-2.3.0, mime-types-1.16, minitest-2.5.1, multi_json-1.8.0, multipart-post-1.2.0, net-scp-1.0.4, net-ssh-2.1.4, nokogiri-1.5.10, rack-1.4.5, rake-0.9.2.2, rbvmomi-1.3.0, rdoc-3.9.5, ruby-hmac-0.4.0, signet-0.4.5, trollop-1.16.2, uuidtools-2.1.4] (Gem::LoadError) from /opt/puppet/lib/ruby/1.9.1/rubygems/specification.rb:777:in
block in activate_dependencies'
from /opt/puppet/lib/ruby/1.9.1/rubygems/specification.rb:766:in each' from /opt/puppet/lib/ruby/1.9.1/rubygems/specification.rb:766:in
activate_dependencies'
from /opt/puppet/lib/ruby/1.9.1/rubygems/specification.rb:750:in activate' from /opt/puppet/lib/ruby/1.9.1/rubygems.rb:1232:in
gem'
from ./eyaml:22:in `
You need to download the gem you want and all dependencies, then install them. Installing the gem without dependencies results in what you see. More importantly, this is an issue with your lack of internet access from the node, not an issue with hiera-eyaml.
Here i installed addressable, autoparse,hiera.eyaml gems. But in the error it is still showing the gems that i downloaded and installed too
hiera-eyaml also has trollop ~> 2.0
and highline ~ > 1.6.19
as dependencies.
Hi,
I installed everything. But it is showing me error /opt/puppet/bin/gem install --force --local *.gem Successfully installed addressable-2.3.8 Successfully installed addressable-2.3.8 Successfully installed autoparse-0.3.3 Successfully installed builder-3.2.2 Successfully installed deep_merge-1.0.0 Successfully installed deep_merge-1.0.1 Successfully installed extlib-0.9.16 Successfully installed fog-1.5.0 Successfully installed fog-1.5.0 Successfully installed formatador-0.2.0 Successfully installed google-api-client-0.6.4 Successfully installed guid-0.1.1 Successfully installed hiera-eyaml-2.0.8 Building native extensions. This could take a while... Successfully installed io-console-0.3 Building native extensions. This could take a while... Successfully installed json-1.5.5 Successfully installed jwt-0.1.8 Successfully installed launchy-2.3.0 Successfully installed mime-types-1.16 Successfully installed minitest-2.5.1 Successfully installed multi_json-1.8.0 Successfully installed multipart-post-1.2.0 Successfully installed net-scp-1.0.4 Successfully installed net-ssh-2.1.4 Successfully installed nokogiri-1.5.10-java Successfully installed rack-1.4.5 Successfully installed rake-0.9.2.2 Successfully installed rbvmomi-1.3.0 Depending on your version of ruby, you may need to install ruby rdoc/ri data:
<= 1.8.6 : unsupported = 1.8.7 : gem install rdoc-data; rdoc-data --install = 1.9.1 : gem install rdoc-data; rdoc-data --install
= 1.9.2 : nothing to do! Yay! Successfully installed rdoc-3.9.5 Successfully installed ruby-hmac-0.4.0 Successfully installed signet-0.4.5 Successfully installed trollop-1.16.2 Successfully installed uuidtools-2.1.4 32 gems installed Installing ri documentation for addressable-2.3.8... Installing ri documentation for addressable-2.3.8... Installing ri documentation for autoparse-0.3.3... Installing ri documentation for builder-3.2.2... Installing ri documentation for deep_merge-1.0.0... Installing ri documentation for deep_merge-1.0.1... Installing ri documentation for extlib-0.9.16... Installing ri documentation for fog-1.5.0... Installing ri documentation for fog-1.5.0... Installing ri documentation for formatador-0.2.0... Installing ri documentation for google-api-client-0.6.4... Installing ri documentation for guid-0.1.1... Installing ri documentation for hiera-eyaml-2.0.8... Installing ri documentation for io-console-0.3... Installing ri documentation for json-1.5.5... Installing ri documentation for jwt-0.1.8... Installing ri documentation for launchy-2.3.0... file 'tomdoc' not found Installing ri documentation for mime-types-1.16... Installing ri documentation for minitest-2.5.1... Installing ri documentation for multi_json-1.8.0... Installing ri documentation for multipart-post-1.2.0... Installing ri documentation for net-scp-1.0.4... Installing ri documentation for net-ssh-2.1.4... unable to convert "\xE7" from ASCII-8BIT to UTF-8 for lib/net/ssh/authentication/pageant.rb, skipping Installing ri documentation for nokogiri-1.5.10-java... Installing ri documentation for rack-1.4.5... Installing ri documentation for rake-0.9.2.2... Installing ri documentation for rbvmomi-1.3.0... Installing ri documentation for rdoc-3.9.5... Installing ri documentation for ruby-hmac-0.4.0... Installing ri documentation for signet-0.4.5... Installing ri documentation for trollop-1.16.2... Installing ri documentation for uuidtools-2.1.4... Installing RDoc documentation for addressable-2.3.8... Installing RDoc documentation for addressable-2.3.8... Installing RDoc documentation for autoparse-0.3.3... Installing RDoc documentation for builder-3.2.2... Installing RDoc documentation for deep_merge-1.0.0... Installing RDoc documentation for deep_merge-1.0.1... Installing RDoc documentation for extlib-0.9.16... Installing RDoc documentation for fog-1.5.0... Installing RDoc documentation for fog-1.5.0...
Installing RDoc documentation for formatador-0.2.0...
Installing RDoc documentation for google-api-client-0.6.4...
Installing RDoc documentation for guid-0.1.1...
Installing RDoc documentation for hiera-eyaml-2.0.8...
Installing RDoc documentation for io-console-0.3...
Installing RDoc documentation for json-1.5.5...
Installing RDoc documentation for jwt-0.1.8...
Installing RDoc documentation for launchy-2.3.0...
file 'tomdoc' not found
Installing RDoc documentation for mime-types-1.16...
Installing RDoc documentation for minitest-2.5.1...
Installing RDoc documentation for multi_json-1.8.0...
Installing RDoc documentation for multipart-post-1.2.0...
Installing RDoc documentation for net-scp-1.0.4...
Installing RDoc documentation for net-ssh-2.1.4...
unable to convert "\xE7" from ASCII-8BIT to UTF-8 for lib/net/ssh/authentication/pageant.rb, skipping
Installing RDoc documentation for nokogiri-1.5.10-java...
Installing RDoc documentation for rack-1.4.5...
Installing RDoc documentation for rake-0.9.2.2...
Installing RDoc documentation for rbvmomi-1.3.0...
Installing RDoc documentation for rdoc-3.9.5...
Installing RDoc documentation for ruby-hmac-0.4.0...
Installing RDoc documentation for signet-0.4.5...
Installing RDoc documentation for trollop-1.16.2...
Installing RDoc documentation for uuidtools-2.1.4...
[root@dot-pap-che-cv1 gem packages]#
[root@dot-pap-che-cv1 gem packages]# cd /opt/puppet/bin/
[root@dot-pap-che-cv1 bin]# ./eyaml encrypt -s 'hello there'
/opt/puppet/lib/ruby/1.9.1/rubygems/dependency.rb:247:in to_specs': Could not find trollop (~> 2.0) amongst [addressable-2.3.8, addressable-2.3.5, autoparse-0.3.3, bigdecimal-1.1.0, builder-3.2.2, builder-3.0.0, deep_merge-1.0.1, deep_merge-1.0.0, excon-0.14.1, extlib-0.9.16, faraday-0.8.8, fog-1.5.0, formatador-0.2.0, google-api-client-0.6.4, guid-0.1.1, hiera-eyaml-2.0.8, io-console-0.3, json-1.5.5, jwt-0.1.8, launchy-2.3.0, mime-types-1.16, minitest-2.5.1, multi_json-1.8.0, multipart-post-1.2.0, net-scp-1.0.4, net-ssh-2.1.4, nokogiri-1.5.10-java, nokogiri-1.5.10, rack-1.4.5, rake-0.9.2.2, rbvmomi-1.3.0, rdoc-3.9.5, ruby-hmac-0.4.0, signet-0.4.5, trollop-1.16.2, uuidtools-2.1.4] (Gem::LoadError) from /opt/puppet/lib/ruby/1.9.1/rubygems/specification.rb:777:in
block in activate_dependencies'
from /opt/puppet/lib/ruby/1.9.1/rubygems/specification.rb:766:in each' from /opt/puppet/lib/ruby/1.9.1/rubygems/specification.rb:766:in
activate_dependencies'
from /opt/puppet/lib/ruby/1.9.1/rubygems/specification.rb:750:in activate' from /opt/puppet/lib/ruby/1.9.1/rubygems.rb:1232:in
gem'
from ./eyaml:22:in `
This is not an issue with hiera-eyaml, you may have better luck in IRC or a support forum for ruby/gems users.
Hi,
I tried to overcome those package issues. But i am having this issue
/opt/puppet/bin/eyaml encrypt -s 'hello there' [hiera-eyaml-core] No such file or directory - ./keys/public_key.pkcs7.pem
But i have it under /var/lib/hiera/keys/
You'll need to tell eyaml where to find the keys. See the documentation for more information on how to do that.
I already specified in /etc/puppetlabs/hiera.yaml file
cat /etc/puppetlabs/puppet/hiera.yaml
:backends:
- eyaml
- yaml
:hierarchy:
- global
- "clientcert/%{clientcert}"
- "environment/%{environment}/%{clientcert}"
- "environment/%{environment}/%{role}"
- "environment/%{environment}/defaults"
- defaults :merge_behaviour: deeper :eyaml: :datadir: '/var/lib/hiera' :pkcs7_private_key: /var/lib/hiera/keys/private_key.pkcs7.pem :pkcs7_public_key: /var/lib/hiera/keys/public_key.pkcs7.pem
Yes, but the eyaml command doesn't read that. You need to tell it where to find the keys. See my link for more.
It would be great to vendor the dependency gems so the external gems are bundled with the main gem.
Maybe I can also build an "offline" or "standalone" gem that has the highline and trollop (and future) dependencies included, although I'm not sure what the ruby best practices are around that?
@TomPoulton I have vendored a few gems before and can issue a PR for this is you wish.
It looks something like this:
gem unpack puppet --version 3.8.1 --target vendor/gems --spec
#gemfile
gem 'puppet', '3.8.1', :path => 'vendor/gems/puppet-3.8.1'
The other alternative is to put the gems inside the puppet-hiera module and install the gems locally
file{'/opt/puppet/packages/public/gems':
ensure => present,
source => 'puppet:///modules/puppetmaster/gems/cache',
recurse => true,
before => Class['hiera'],
owner => 'root',
group => 'root',
}
exec{['gem install --local --no-rdoc --no-ri /opt/puppet/packages/public/gems/trollop-2.1.2.gem',
'gem install --local --no-rdoc --no-ri /opt/puppet/packages/public/gems/highline-1.6.21.gem',
'gem install --local --no-rdoc --no-ri /opt/puppet/packages/public/gems/hiera-eyaml-2.0.8.gem']:
path => ['/opt/puppet/bin', '/usr/bin', '/bin' ],
creates => '/opt/puppet/bin/eyaml',
require => File['/opt/puppet/packages/public/gems'],
before => Exec['change ownership of puppetserver gems dir','change ownership of gems dir'],
}
Thanks @logicminds, I think I can use bundler to download gems to a "local" directory e.g. bundle install --path vendor
How do you get bundler (or rake or gem or whatever) to package the vendor gems into the built gem? Is it a convention around the vendor/gems
directory or the relative path in the gemfile?