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

Upgrade support for Puppet 5.0 #382

Open
WetHippie opened this issue Jul 3, 2017 · 7 comments
Open

Upgrade support for Puppet 5.0 #382

WetHippie opened this issue Jul 3, 2017 · 7 comments

Comments

@WetHippie
Copy link

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 5.0.x
  • Ruby: 2.4.0 (as required by puppet 5)
  • Distribution: All
  • Module version: 6.10.x

How to reproduce (e.g Puppet code you use)

Upgrade of puppet 5.0 by use of puppetlabs/puppet_agent. Auto install of the latest version (after manually setting the new ::source)

What are you seeing

With the new version of puppet and ruby, the gem isn't installed to run r10k with on the command line (and similar when auto managed using this module)

/opt/puppetlabs/puppet/lib/ruby/2.4.0/rubygems/dependency.rb:308:in `to_specs': Could not find 'r10k' (>= 0) among 27 total gem(s) (Gem::MissingSpecError)
Checked in 'GEM_PATH=/root/.gem/ruby/2.4.0:/opt/puppetlabs/puppet/lib/ruby/gems/2.4.0', execute `gem env` for more information
	from /opt/puppetlabs/puppet/lib/ruby/2.4.0/rubygems/dependency.rb:320:in `to_spec'
	from /opt/puppetlabs/puppet/lib/ruby/2.4.0/rubygems/core_ext/kernel_gem.rb:65:in `gem'
	from /bin/r10k:22:in `<main>'

What behaviour did you expect instead

Difficult to say other than "should make sure the new gem is auto installed with ruby 2.4. However, this is a chicken an egg situation in that ruby won't be installed until puppet is, and then once it is, puppet can't run in order to get r10k to update itself.

Output log

See above

Any additional information you'd like to impart

None.

@rnelson0
Copy link
Member

rnelson0 commented Jul 4, 2017

@WetHippie I can't upgrade to Puppet 5 w/ r10k myself (I'm a PE user) but can you share the manifest you're using to manage the r10k gem installation? I'm sure we can troubleshoot it with enough eyes on it.

@WetHippie
Copy link
Author

WetHippie commented Jul 4, 2017

I ended up getting stuck with a chicken and egg situation with the module and dependencies since I could not get r10k to run to pull in the new dependencies. I had to manually install the r10k gem from the command line, so I'm not much help either :(

On the command line I used

/opt/puppetlabs/puppet/bin/gem install r10k

and since the latest puppet server was already at 5.0.x, it placed the r10k installation into the right version of the ruby directory (in this case 2.4.0)

@rnelson0
Copy link
Member

@WetHippie I can't help with this right now, but we can leave it open in the hopes that someone else can either verify the problem and test some fixes, or determine that it was a one-off issue. Hopefully, the next PE edition with Puppet 5 in it launches soon, and then I might be able to help myself. Thanks!

@rsynnest
Copy link

rsynnest commented Sep 7, 2018

@WetHippie I experienced the same issue after upgrading my puppet master from v4.10.12 to v5.5.6 yesterday on Ubuntu 16.04. Your workaround (/opt/puppetlabs/puppet/bin/gem install r10k) worked for me as well. I believe my original r10k install was via this method, which uses the same manual install command (/opt/puppetlabs/puppet/bin/gem install r10k), so I guess it makes sense that I would need to manually install r10k again after upgrading. Sounds like @rnelson's recommendation of installing r10k via Puppet may be better and would carry over a proper r10k version across upgrades?

@kenyon
Copy link
Member

kenyon commented Dec 5, 2018

You need to use puppetserver_gem to have puppet install the r10k gem. https://forge.puppet.com/puppetlabs/puppetserver_gem

@dhoppe
Copy link
Member

dhoppe commented May 10, 2019

@kenyon Is this still necessary? Do we need to update the docs?

@kenyon
Copy link
Member

kenyon commented May 11, 2019

@dhoppe I guess it's still necessary. This is what I do:

  Package['ruby'] -> Package <| provider == 'gem' |>

  # Ruby gems.
  lookup('gems', Array[String], 'unique').each |String $gem| {
    package { "gem_${gem}":
      ensure          => installed,
      provider        => gem,
      name            => $gem,
      install_options => ['--http-proxy', "http://${lookup('proxy.host')}:${lookup('proxy.port')}"],
    }
  }
class mysite::nodes::puppet (Array[String] $puppetserver_gems) {
  # Ruby gems for the puppetserver embedded Ruby environment.
  $puppetserver_gems.each |String $pkg| {
    package { "puppetserver_gem_${pkg}":
      ensure          => installed,
      provider        => puppetserver_gem,
      name            => $pkg,
      install_options => ['--http-proxy', "http://${lookup('proxy.host')}:${lookup('proxy.port')}"],
    }
  }
}

In hiera:

gems:
  - r10k

mysite::nodes::puppet::puppetserver_gems:
  - r10k

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

No branches or pull requests

5 participants