Autosign and default Host Group

Hi all!

I'm using autosign feature in foreman/puppet, but when new host added it
doesn't have any Group and puppet classes assigned.
Currently to solve that I had setup node definition in puppet main site.pp
where I assign "bootstrap" puppet classes, needed for basic host setup.
But this is not "foreman-way", then I can't see these assigned classes via
foreman.

So the question:

  • is it possible to set an default "Host Group" in foreman, so all newly
    added nodes will be assigned to this group?

Thanks!

You might want to look at
https://github.com/GregSutcliffe/foreman_default_hostgroup.

I haven't used it, but it seems like it would accomplish what you're
looking for.

··· On Thursday, September 5, 2013 7:56:05 AM UTC-4, Roman Voitenko wrote: > > Hi all! > > I'm using autosign feature in foreman/puppet, but when new host added it > doesn't have any Group and puppet classes assigned. > Currently to solve that I had setup node definition in puppet main > site.pp where I assign "bootstrap" puppet classes, needed for basic host > setup. > But this is not "foreman-way", then I can't see these assigned classes via > foreman. > > So the question: > - is it possible to set an default "Host Group" in foreman, so all newly > added nodes will be assigned to this group? > > Thanks! > >

Works like a charm!
thanks

··· On Thursday, 5 September 2013 16:01:22 UTC+2, Andy Bohne wrote: > > You might want to look at > https://github.com/GregSutcliffe/foreman_default_hostgroup. > > I haven't used it, but it seems like it would accomplish what you're > looking for. > > On Thursday, September 5, 2013 7:56:05 AM UTC-4, Roman Voitenko wrote: >> >> Hi all! >> >> I'm using autosign feature in foreman/puppet, but when new host added it >> doesn't have any Group and puppet classes assigned. >> Currently to solve that I had setup node definition in puppet main >> site.pp where I assign "bootstrap" puppet classes, needed for basic host >> setup. >> But this is not "foreman-way", then I can't see these assigned classes >> via foreman. >> >> So the question: >> - is it possible to set an default "Host Group" in foreman, so all >> newly added nodes will be assigned to this group? >> >> Thanks! >> >> >

Glad it helped! That plugin is a nasty hack though, I should rewrite it :wink:

Greg

··· On 5 September 2013 23:15, Roman Voitenko wrote:

Works like a charm!
thanks

Hi!
How did you install the plugin?
I've build gem, installed it, added "gem 'foreman_default_group'" to the
~foreman/bundler.d/foreman_default_group.rb
After Apache restart it complains that

Could not find rake-10.1.0 in any of the sources (Bundler::GemNotFound)

··· On Thursday, September 5, 2013 3:15:48 PM UTC-7, Roman Voitenko wrote: > > Works like a charm! > thanks > > On Thursday, 5 September 2013 16:01:22 UTC+2, Andy Bohne wrote: >> >> You might want to look at >> https://github.com/GregSutcliffe/foreman_default_hostgroup. >> >> I haven't used it, but it seems like it would accomplish what you're >> looking for. >> >> On Thursday, September 5, 2013 7:56:05 AM UTC-4, Roman Voitenko wrote: >>> >>> Hi all! >>> >>> I'm using autosign feature in foreman/puppet, but when new host added >>> it doesn't have any Group and puppet classes assigned. >>> Currently to solve that I had setup node definition in puppet main >>> site.pp where I assign "bootstrap" puppet classes, needed for basic host >>> setup. >>> But this is not "foreman-way", then I can't see these assigned classes >>> via foreman. >>> >>> So the question: >>> - is it possible to set an default "Host Group" in foreman, so all >>> newly added nodes will be assigned to this group? >>> >>> Thanks! >>> >>> >>

thanks for it anyway :wink:
Don't you want to propose such feature to be included in foreman?

Question: what do you think about improving plugin by assign group to host
based on its name? no need to have full support of regexp, but something
like
www* - > webgrp, db* -> dbgrp would be awesome

··· On Friday, 6 September 2013 10:55:45 UTC+2, Greg Sutcliffe wrote: > > On 5 September 2013 23:15, Roman Voitenko <r00...@gmail.com >wrote: > >> Works like a charm! >> thanks >> > > Glad it helped! That plugin is a nasty hack though, I should rewrite it ;) > > Greg >

> thanks for it anyway :wink:
> Don't you want to propose such feature to be included in foreman?
>

As a core dev I could write it easily enough :stuck_out_tongue:

However plugins are useful for testing how popular a feature is before
adding it to core. As KK (author of Jenkins said) with plugins, every crazy
idea gets a shot. It it becomes popular, we can add it to core.

It's also useful as an example for people to use when writing their own
plugins (in this case, an example of how not to do it :P)

Question: what do you think about improving plugin by assign group to host
> based on its name? no need to have full support of regexp, but something
> like
> www* - > webgrp, db* -> dbgrp would be awesome
>

That would be a great extension, assuming I ever find some time to work on
it. Patches welcome, of course :smiley:

··· On 6 September 2013 10:08, Roman Voitenko wrote:

Hi,

did you read instructions
at https://github.com/GregSutcliffe/foreman_default_hostgroup ?
Simply add string:
gem 'foreman_default_hostgroup', :git =>
'https://github.com/GregSutcliffe/foreman_default_hostgroup'

to /usr/share/foreman/Gemfile
then:
/usr/share/foreman
bundle update

··· On Friday, 20 September 2013 00:10:12 UTC+2, Alexey Savva wrote: > > Hi! > How did you install the plugin? > I've build gem, installed it, added "gem 'foreman_default_group'" to the > ~foreman/bundler.d/foreman_default_group.rb > After Apache restart it complains that > > Could not find rake-10.1.0 in any of the sources (Bundler::GemNotFound) > > > On Thursday, September 5, 2013 3:15:48 PM UTC-7, Roman Voitenko wrote: >> >> Works like a charm! >> thanks >> >> On Thursday, 5 September 2013 16:01:22 UTC+2, Andy Bohne wrote: >>> >>> You might want to look at >>> https://github.com/GregSutcliffe/foreman_default_hostgroup. >>> >>> I haven't used it, but it seems like it would accomplish what you're >>> looking for. >>> >>> On Thursday, September 5, 2013 7:56:05 AM UTC-4, Roman Voitenko wrote: >>>> >>>> Hi all! >>>> >>>> I'm using autosign feature in foreman/puppet, but when new host added >>>> it doesn't have any Group and puppet classes assigned. >>>> Currently to solve that I had setup node definition in puppet main >>>> site.pp where I assign "bootstrap" puppet classes, needed for basic host >>>> setup. >>>> But this is not "foreman-way", then I can't see these assigned classes >>>> via foreman. >>>> >>>> So the question: >>>> - is it possible to set an default "Host Group" in foreman, so all >>>> newly added nodes will be assigned to this group? >>>> >>>> Thanks! >>>> >>>> >>>

>
>
>> Hi!
>> How did you install the plugin?
>> I've build gem, installed it, added "gem 'foreman_default_group'" to the
>> ~foreman/bundler.d/foreman_**default_group.rb
>> After Apache restart it complains that
>>
>> Could not find rake-10.1.0 in any of the sources (Bundler::GemNotFound)
>>
>> Which OS are you on? The commands to install a plugin gem are different
on different OSes…

··· > On Friday, 20 September 2013 00:10:12 UTC+2, Alexey Savva wrote:

OS: CentOS 6.4 x86_64
Foreman 1.2 was installed using RPMs
Here is Passenger error trace:
http://pastebin.com/6pwPdkAK
Thanks for trying to help me. I used to write Ruby programs, but totally
unfamiliar with Rails stack stuff :frowning:

··· On Friday, September 20, 2013 2:53:04 AM UTC-7, Greg Sutcliffe wrote: > > On Friday, 20 September 2013 00:10:12 UTC+2, Alexey Savva wrote: >> >>> Hi! >>> How did you install the plugin? >>> I've build gem, installed it, added "gem 'foreman_default_group'" to the >>> ~foreman/bundler.d/foreman_**default_group.rb >>> After Apache restart it complains that >>> >>> Could not find rake-10.1.0 in any of the sources (Bundler::GemNotFound) >>> >>> Which OS are you on? The commands to install a plugin gem are different > on different OSes... >

Alexey,

Did you find a solution here? I had a similar result, but with a different
gem. Your problem relates to the rake gem, which might be resolved by
doing a # gem install rake…but that may lead to what I have.

Take a look at my paste [1], I've got the i18n gem installed and the bundle
finds it, but Passenger apparently doesn't. There are bunch of google hits
around about errors like this, but none of them that I've tried seem to
help. selinux is not in play in my case.

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

Kind regards,

··· On Friday, September 20, 2013 6:34:36 PM UTC-4, Alexey Savva wrote: > > OS: CentOS 6.4 x86_64 > Foreman 1.2 was installed using RPMs > Here is Passenger error trace: > http://pastebin.com/6pwPdkAK > Thanks for trying to help me. I used to write Ruby programs, but totally > unfamiliar with Rails stack stuff :( > > On Friday, September 20, 2013 2:53:04 AM UTC-7, Greg Sutcliffe wrote: >> >> On Friday, 20 September 2013 00:10:12 UTC+2, Alexey Savva wrote: >>> >>>> Hi! >>>> How did you install the plugin? >>>> I've build gem, installed it, added "gem 'foreman_default_group'" to >>>> the ~foreman/bundler.d/foreman_**default_group.rb >>>> After Apache restart it complains that >>>> >>>> Could not find rake-10.1.0 in any of the sources (Bundler::GemNotFound) >>>> >>>> Which OS are you on? The commands to install a plugin gem are different >> on different OSes... >> >