theforeman / puppet-foreman_proxy

Puppet module for Foreman Smart Proxy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

puppet 7: Could not find a suitable provider for foreman_smartproxy

TheMeier opened this issue · comments

Just upgraded to puppet 7 and had to set foreman_proxy::register_in_foreman to false otherwise an erro occurs:

Could not find a suitable provider for foreman_smartproxy

The oauth2 gem is required. I'm guessing you need to reinstall that in the AIO Puppet environment since it was upgraded from Ruby 2.5 to Ruby 2.7 so some install paths may have changed. We had the same thing with Puppet 5 to 6 (2.4 to 2.5).

Thanks @ekohl could you please elaborate. Where is this gem needed? On the puppetserver or the agent?

Ok found it sudo yum reinstall puppet-agent-oauth on the agent fixed it. The gem logs some warnings though:

/opt/puppetlabs/puppet/cache/lib/puppet/provider/foreman_resource/rest_v3.rb:62: warning: URI.escape is obsolete
/opt/puppetlabs/puppet/cache/lib/puppet/provider/foreman_resource/rest_v3.rb:62: warning: URI.escape is obsolete
/opt/puppetlabs/puppet/lib/ruby/gems/2.7.0/gems/oauth-0.5.1/lib/oauth/helper.rb:12: warning: URI.escape is obsolete
/opt/puppetlabs/puppet/lib/ruby/gems/2.7.0/gems/oauth-0.5.1/lib/oauth/helper.rb:12: warning: URI.escape is obsolete
/opt/puppetlabs/puppet/lib/ruby/gems/2.7.0/gems/oauth-0.5.1/lib/oauth/helper.rb:12: warning: URI.escape is obsolete
/opt/puppetlabs/puppet/lib/ruby/gems/2.7.0/gems/oauth-0.5.1/lib/oauth/helper.rb:12: warning: URI.escape is obsolete
/opt/puppetlabs/puppet/lib/ruby/gems/2.7.0/gems/oauth-0.5.1/lib/oauth/helper.rb:12: warning: URI.escape is obsolete
/opt/puppetlabs/puppet/lib/ruby/gems/2.7.0/gems/oauth-0.5.1/lib/oauth/helper.rb:12: warning: URI.escape is obsolete
/opt/puppetlabs/puppet/lib/ruby/gems/2.7.0/gems/oauth-0.5.1/lib/oauth/helper.rb:12: warning: URI.escape is obsolete
/opt/puppetlabs/puppet/lib/ruby/gems/2.7.0/gems/oauth-0.5.1/lib/oauth/helper.rb:12: warning: URI.escape is obsolete
/opt/puppetlabs/puppet/lib/ruby/gems/2.7.0/gems/oauth-0.5.1/lib/oauth/helper.rb:12: warning: URI.escape is obsolete
/opt/puppetlabs/puppet/lib/ruby/gems/2.7.0/gems/oauth-0.5.1/lib/oauth/helper.rb:12: warning: URI.escape is obsolete
/opt/puppetlabs/puppet/lib/ruby/gems/2.7.0/gems/oauth-0.5.1/lib/oauth/helper.rb:12: warning: URI.escape is obsolete
/opt/puppetlabs/puppet/lib/ruby/gems/2.7.0/gems/oauth-0.5.1/lib/oauth/helper.rb:12: warning: URI.escape is obsolete
/opt/puppetlabs/puppet/lib/ruby/gems/2.7.0/gems/oauth-0.5.1/lib/oauth/helper.rb:12: warning: URI.escape is obsolete
/opt/puppetlabs/puppet/lib/ruby/gems/2.7.0/gems/oauth-0.5.1/lib/oauth/helper.rb:12: warning: URI.escape is obsolete
/opt/puppetlabs/puppet/lib/ruby/gems/2.7.0/gems/oauth-0.5.1/lib/oauth/helper.rb:12: warning: URI.escape is obsolete
/opt/puppetlabs/puppet/lib/ruby/gems/2.7.0/gems/oauth-0.5.1/lib/oauth/helper.rb:12: warning: URI.escape is obsolete
/opt/puppetlabs/puppet/lib/ruby/gems/2.7.0/gems/oauth-0.5.1/lib/oauth/helper.rb:12: warning: URI.escape is obsolete
/opt/puppetlabs/puppet/lib/ruby/gems/2.7.0/gems/oauth-0.5.1/lib/oauth/helper.rb:12: warning: URI.escape is obsolete
/opt/puppetlabs/puppet/lib/ruby/gems/2.7.0/gems/oauth-0.5.1/lib/oauth/helper.rb:12: warning: URI.escape is obsolete
/opt/puppetlabs/puppet/lib/ruby/gems/2.7.0/gems/oauth-0.5.1/lib/oauth/helper.rb:12: warning: URI.escape is obsolete
/opt/puppetlabs/puppet/lib/ruby/gems/2.7.0/gems/oauth-0.5.1/lib/oauth/helper.rb:12: warning: URI.escape is obsolete
/opt/puppetlabs/puppet/lib/ruby/gems/2.7.0/gems/oauth-0.5.1/lib/oauth/helper.rb:12: warning: URI.escape is obsolete
/opt/puppetlabs/puppet/lib/ruby/gems/2.7.0/gems/oauth-0.5.1/lib/oauth/helper.rb:12: warning: URI.escape is obsolete

That is indeed what I meant. It looks like we're not on the latest version (0.5.4), but that's already 3 years old. Doesn't look like they fixed the warning there.

https://github.com/theforeman/puppet-foreman/blob/c3c090ce8645a3f3da9cf7290ac13cab1503d8c6/lib/puppet/provider/foreman_resource/rest_v3.rb#L62 does look easy to fix. There it should really use CGI.escape instead of URI.escape.

theforeman/puppet-foreman#911 should do that. If you have the time, please test it.