How to map hostgroup with a fact

Hi,

I'm trying to map all my hosts into correct hostgroup based on an
information provided by one of my customized facts.
Can anyone tell me what would be the best way to approach it?

Thanks,
Chris

> Hi,
>
> I'm trying to map all my hosts into correct hostgroup based on an
> information provided by one of my customized facts.
> Can anyone tell me what would be the best way to approach it?

using search, on the hosts page type something like
facts.<your fact> = vlaue
then click on the toggle all checkbox
if its multiple result, keep on selecting all hosts in the other pages too
then on the right top, you have a dropdown for multiple actions,
select change hostgroup
and walla.

cheers,
Ohad

··· On Thu, Mar 1, 2012 at 12:09 PM, Chris wrote: > > Thanks, > Chris > > -- > You received this message because you are subscribed to the Google Groups "Foreman users" group. > To post to this group, send email to foreman-users@googlegroups.com. > To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/foreman-users?hl=en. >

That's really cool. Thanks for your reply Ohad but is there an
automated way to put hosts into correct hostgroup?

Thanks,
Chris

··· On Mar 1, 10:36 am, Ohad Levy wrote: > On Thu, Mar 1, 2012 at 12:09 PM, Chris wrote: > > Hi, > > > I'm trying to map all my hosts into correct hostgroup based on an > > information provided by one of my customized facts. > > Can anyone tell me what would be the best way to approach it? > > using search, on the hosts page type something like > facts. = vlaue > then click on the toggle all checkbox > if its multiple result, keep on selecting all hosts in the other pages too > then on the right top, you have a dropdown for multiple actions, > select change hostgroup > and walla. > > cheers, > Ohad > > > > > > > > > > > Thanks, > > Chris > > > -- > > You received this message because you are subscribed to the Google Groups "Foreman users" group. > > To post to this group, send email to foreman-users@googlegroups.com. > > To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com. > > For more options, visit this group athttp://groups.google.com/group/foreman-users?hl=en.

Hi Chris,

We don't have an automated way yet, please feel free to add a feature
request, and hopefully someone with free cycles can implement it (or
you can :))

Ohad

··· On Thu, Mar 1, 2012 at 4:27 PM, Chris wrote: > That's really cool. Thanks for your reply Ohad but is there an > automated way to put hosts into correct hostgroup? > > Thanks, > Chris > > On Mar 1, 10:36 am, Ohad Levy wrote: >> On Thu, Mar 1, 2012 at 12:09 PM, Chris wrote: >> > Hi, >> >> > I'm trying to map all my hosts into correct hostgroup based on an >> > information provided by one of my customized facts. >> > Can anyone tell me what would be the best way to approach it? >> >> using search, on the hosts page type something like >> facts. = vlaue >> then click on the toggle all checkbox >> if its multiple result, keep on selecting all hosts in the other pages too >> then on the right top, you have a dropdown for multiple actions, >> select change hostgroup >> and walla. >> >> cheers, >> Ohad >> >> >> >> >> >> >> >> >> >> > Thanks, >> > Chris >> >> > -- >> > You received this message because you are subscribed to the Google Groups "Foreman users" group. >> > To post to this group, send email to foreman-users@googlegroups.com. >> > To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com. >> > For more options, visit this group athttp://groups.google.com/group/foreman-users?hl=en. > > -- > You received this message because you are subscribed to the Google Groups "Foreman users" group. > To post to this group, send email to foreman-users@googlegroups.com. > To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/foreman-users?hl=en. >

> That's really cool. Thanks for your reply Ohad but is there an
> automated way to put hosts into correct hostgroup?
Or, you can automate it via the API in a script.

for example, you could build something on top of this gist:

Ohad

··· On Thu, Mar 1, 2012 at 4:27 PM, Chris wrote: > > Thanks, > Chris > > On Mar 1, 10:36 am, Ohad Levy wrote: >> On Thu, Mar 1, 2012 at 12:09 PM, Chris wrote: >> > Hi, >> >> > I'm trying to map all my hosts into correct hostgroup based on an >> > information provided by one of my customized facts. >> > Can anyone tell me what would be the best way to approach it? >> >> using search, on the hosts page type something like >> facts. = vlaue >> then click on the toggle all checkbox >> if its multiple result, keep on selecting all hosts in the other pages too >> then on the right top, you have a dropdown for multiple actions, >> select change hostgroup >> and walla. >> >> cheers, >> Ohad >> >> >> >> >> >> >> >> >> >> > Thanks, >> > Chris >> >> > -- >> > You received this message because you are subscribed to the Google Groups "Foreman users" group. >> > To post to this group, send email to foreman-users@googlegroups.com. >> > To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com. >> > For more options, visit this group athttp://groups.google.com/group/foreman-users?hl=en. > > -- > You received this message because you are subscribed to the Google Groups "Foreman users" group. > To post to this group, send email to foreman-users@googlegroups.com. > To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/foreman-users?hl=en. >

That's something we're almost certain to be doing in the next few
months. It's a really nice approach - you can put the appropriate
hostgroup in whatever build-scripts you have.

··· On 1 March 2012 15:03, Ohad Levy wrote: > On Thu, Mar 1, 2012 at 4:27 PM, Chris wrote: >> That's really cool. Thanks for your reply Ohad but is there an >> automated way to put hosts into correct hostgroup? > Or, you can automate it via the API in a script. > > for example, you could build something on top of this gist: > https://gist.github.com/1947339