Foreman_default_hostgroup Plugin Install Problems

Greg,
It seems like there are a few of us on the list who are having trouble
getting this cool plugin you've built loaded up. I thought about filing an
issue on GitHub but thought maybe this is my problem and not the plugins.
I decided to post a new thread instead of hijacking the other's.

I've got a git-gist of junk regarding my particular problem [1], and I'm
wondering if it all comes down to GEM_PATH and Gem Environment. It seems
that all the passenger stuff is using Ruby 1.9.x gems, but my host
environment for both Foreman User and Root is all using Ruby 1.8.

Is there a quick fix on this?

Many thanks!

[1] https://gist.github.com/salderma/6705450

> Greg,
> It seems like there are a few of us on the list who are having trouble
> getting this cool plugin you've built loaded up. I thought about filing
> an issue on GitHub but thought maybe this is my problem and not the
> plugins. I decided to post a new thread instead of hijacking the other's.
>
> I've got a git-gist of junk regarding my particular problem [1], and I'm
> wondering if it all comes down to GEM_PATH and Gem Environment. It
> seems that all the passenger stuff is using Ruby 1.9.x gems, but my host
> environment for both Foreman User and Root is all using Ruby 1.8.

Yes, you should use "scl enable ruby193" to switch into the 1.9
environment. See
Foreman :: Manual.

> Is there a quick fix on this?
>
> Many thanks!
>
> [1] https://gist.github.com/salderma/6705450

I'd ignore the stuff installed now into the 1.8 environment now (but
maybe it should be removed via gem uninstall some time). I'd begin by
removing Gemfile and Gemfile.lock, only leave Gemfile.in (as provided by
our packages). We don't actually use bundler directly in the RPMs now.

Next, install the dependency and gem with:

scl enable ruby193 'gem install --ignore-dependencies
foreman_default_hostgroup'
rpm -Uvh
http://yum.theforeman.org/plugins/1.2/el6/x86_64/ruby193-rubygem-deface-0.7.2-6.el6.noarch.rpm

And configure Foreman so it finds it:

echo "gem 'foreman_default_hostgroup'" >
/usr/share/foreman/bundler.d/foreman_default_hostgroup.rb

You can then be able to restart httpd and it should load.

I'd like to get this packaged as an RPM for our plugins repo, but it
needs a rewrite before we can really support it (e.g. with 1.3).

Cheers,

··· On 27/09/13 19:03, Sean Alderman wrote:


Dominic Cleal
Red Hat Engineering

I forgot to say, keep an eye on this list to see which plugins have RPMs
built (suggestions gladly taken):
http://projects.theforeman.org/projects/foreman/wiki/List_of_Plugins

And this for installing them:
http://projects.theforeman.org/projects/foreman/wiki/How_to_Install_a_Plugin

··· On 27/09/13 19:23, Dominic Cleal wrote: > On 27/09/13 19:03, Sean Alderman wrote: >> Greg, >> It seems like there are a few of us on the list who are having trouble >> getting this cool plugin you've built loaded up. I thought about filing >> an issue on GitHub but thought maybe this is my problem and not the >> plugins. I decided to post a new thread instead of hijacking the other's. >> >> I've got a git-gist of junk regarding my particular problem [1], and I'm >> wondering if it all comes down to GEM_PATH and Gem Environment. It >> seems that all the passenger stuff is using Ruby 1.9.x gems, but my host >> environment for both Foreman User and Root is all using Ruby 1.8. > > Yes, you should use "scl enable ruby193" to switch into the 1.9 > environment. See > http://theforeman.org/manuals/1.2/index.html#3.3.2SoftwareCollections. > >> Is there a quick fix on this? >> >> Many thanks! >> >> [1] https://gist.github.com/salderma/6705450 > > I'd ignore the stuff installed now into the 1.8 environment now (but > maybe it should be removed via gem uninstall some time). I'd begin by > removing Gemfile and Gemfile.lock, only leave Gemfile.in (as provided by > our packages). We don't actually use bundler directly in the RPMs now. > > Next, install the dependency and gem with: > > scl enable ruby193 'gem install --ignore-dependencies > foreman_default_hostgroup' > rpm -Uvh > http://yum.theforeman.org/plugins/1.2/el6/x86_64/ruby193-rubygem-deface-0.7.2-6.el6.noarch.rpm > > And configure Foreman so it finds it: > > echo "gem 'foreman_default_hostgroup'" > > /usr/share/foreman/bundler.d/foreman_default_hostgroup.rb > > You can then be able to restart httpd and it should load. > > I'd like to get this packaged as an RPM for our plugins repo, but it > needs a rewrite before we can really support it (e.g. with 1.3).


Dominic Cleal
Red Hat Engineering

Thanks for reply with th install stuff, Dominic, SCL still confuses the
hell out of me :stuck_out_tongue:

I'm really hoping to get a rewrite of default_hostgroup done over the
weekend. We'll see how it goes.

Many thanks! I'm with Greg, but I'm sure he knows tons more about ruby
than I do. All seems to be installed and working.

I'm not sure where the ruby 1.8 stuff came from, perhaps lingering from an
old version of foreman that was installed but not running when I
commandeered our Foreman server.

··· On Friday, September 27, 2013 3:49:39 PM UTC-4, Greg Sutcliffe wrote: > > Thanks for reply with th install stuff, Dominic, SCL still confuses the > hell out of me :P > > I'm really hoping to get a rewrite of default_hostgroup done over the > weekend. We'll see how it goes. >

Ok, 1.3-compatible version is up on plugin Github repo[1]. Give it a test.
Dominic, any chance you could give the code a look-over.

This is a nice simple plugin, so I'm hoping to use it as a starting point
for figuring out a good way to add tests to a plugin. We'll see how that
goes :slight_smile:

Greg

[1]https://github.com/GregSutcliffe/foreman_default_hostgroup/tree/1.3

··· On 27 September 2013 20:49, Greg Sutcliffe wrote:

Thanks for reply with th install stuff, Dominic, SCL still confuses the
hell out of me :stuck_out_tongue:

I’m really hoping to get a rewrite of default_hostgroup done over the
weekend. We’ll see how it goes.

Just a heads up for those who haven't already spotted it - the 1.3 version
of the plugin got packaged for RPM a while back. Give it a spin :slight_smile:

http://yum.theforeman.org/plugins/1.3/f19/x86_64/rubygem-foreman_default_hostgroup-1.0.0-1.fc19.noarch.rpm

Greg

··· On 28 September 2013 12:45, Greg Sutcliffe wrote:

Ok, 1.3-compatible version is up on plugin Github repo[1]. Give it a test.
Dominic, any chance you could give the code a look-over.

Though please use the repo appropriate for your OS, not just the F19 RPM :slight_smile:

··· On 21/10/13 15:26, Greg Sutcliffe wrote: > On 28 September 2013 12:45, Greg Sutcliffe > wrote: > > Ok, 1.3-compatible version is up on plugin Github repo[1]. Give it a > test. Dominic, any chance you could give the code a look-over. > > > Just a heads up for those who haven't already spotted it - the 1.3 > version of the plugin got packaged for RPM a while back. Give it a spin :) > > http://yum.theforeman.org/plugins/1.3/f19/x86_64/rubygem-foreman_default_hostgroup-1.0.0-1.fc19.noarch.rpm


Dominic Cleal
Red Hat Engineering