Packaging Host Groups and Configuration Groups?

In my development environment I've developed a library of classes, host
groups and configuration groups. Is there a way to export that information
from Foreman and import that in another Foreman?

The short answer is "not easily". Obviously there's the sledgehammer
approach of a complete DB dump - I'll assume that's not acceptable
here. After that, your only other option is to script it via the API
(or Hammer), which could get messy, depending on what needs moving.

Some kind of sync tool is interesting, but it becomes a complete DB
migration if you're not very careful (from a generic viewpoint). For
example, suppose I sync the hostgroups from A to B. If one of those
hostgroups contains a subnet, then potentially I have to make sure the
subnets are synced. Likewise, smart proxies, operatingsystems,
domains, architectures, classes, mirrors and partition tables. All
just for hostgroups, but then each of those entities will have
required associations too. So, while I agree this kind of tool is
handy, we need a sensible approach for handling associations,
especially with regard to what action to take when the user decides
not to sync certain elements.

Do raise it on the issue tracker, I think it's a useful idea - it'll
just have to be implemented carefully :slight_smile:

Greg

··· On 4 March 2015 at 19:35, Peter Berghold wrote: > In my development environment I've developed a library of classes, host > groups and configuration groups. Is there a way to export that information > from Foreman and import that in another Foreman?

I've created issue #9676 <Feature #9676: Sync of data between Foreman installations - Foreman> on
the issue tracker

··· On Fri, Mar 6, 2015 at 5:30 AM Greg Sutcliffe wrote:

On 4 March 2015 at 19:35, Peter Berghold salty.cowdawg@gmail.com wrote:

In my development environment I’ve developed a library of classes, host
groups and configuration groups. Is there a way to export that
information
from Foreman and import that in another Foreman?

The short answer is “not easily”. Obviously there’s the sledgehammer
approach of a complete DB dump - I’ll assume that’s not acceptable
here. After that, your only other option is to script it via the API
(or Hammer), which could get messy, depending on what needs moving.

Some kind of sync tool is interesting, but it becomes a complete DB
migration if you’re not very careful (from a generic viewpoint). For
example, suppose I sync the hostgroups from A to B. If one of those
hostgroups contains a subnet, then potentially I have to make sure the
subnets are synced. Likewise, smart proxies, operatingsystems,
domains, architectures, classes, mirrors and partition tables. All
just for hostgroups, but then each of those entities will have
required associations too. So, while I agree this kind of tool is
handy, we need a sensible approach for handling associations,
especially with regard to what action to take when the user decides
not to sync certain elements.

Do raise it on the issue tracker, I think it’s a useful idea - it’ll
just have to be implemented carefully :slight_smile:

Greg


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.

Peter, there is https://github.com/katello/hammer-cli-csv which you
can use to export and import Foreman models in CSV.
Currently it doesn't support host groups, config groups or puppet
classes (unfortunately) but it seems like the appropriate tool for
this.

··· On Sat, Mar 7, 2015 at 5:33 PM, Peter Berghold wrote: > I've created issue #9676 on the issue tracker > > On Fri, Mar 6, 2015 at 5:30 AM Greg Sutcliffe > wrote: >> >> On 4 March 2015 at 19:35, Peter Berghold wrote: >> > In my development environment I've developed a library of classes, host >> > groups and configuration groups. Is there a way to export that >> > information >> > from Foreman and import that in another Foreman? >> >> The short answer is "not easily". Obviously there's the sledgehammer >> approach of a complete DB dump - I'll assume that's not acceptable >> here. After that, your only other option is to script it via the API >> (or Hammer), which could get messy, depending on what needs moving. >> >> Some kind of sync tool is interesting, but it becomes a complete DB >> migration if you're not very careful (from a generic viewpoint). For >> example, suppose I sync the hostgroups from A to B. If one of those >> hostgroups contains a subnet, then potentially I have to make sure the >> subnets are synced. Likewise, smart proxies, operatingsystems, >> domains, architectures, classes, mirrors and partition tables. All >> just for hostgroups, but then each of those entities will have >> required associations too. So, while I agree this kind of tool is >> handy, we need a sensible approach for handling associations, >> especially with regard to what action to take when the user decides >> not to sync certain elements. >> >> Do raise it on the issue tracker, I think it's a useful idea - it'll >> just have to be implemented carefully :) >> >> Greg >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Foreman users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to foreman-users+unsubscribe@googlegroups.com. >> To post to this group, send email to foreman-users@googlegroups.com. >> Visit this group at http://groups.google.com/group/foreman-users. >> For more options, visit https://groups.google.com/d/optout. > > -- > You received this message because you are subscribed to the Google Groups > "Foreman users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to foreman-users+unsubscribe@googlegroups.com. > To post to this group, send email to foreman-users@googlegroups.com. > Visit this group at http://groups.google.com/group/foreman-users. > For more options, visit https://groups.google.com/d/optout.


Daniel Lobato

@elobatoss
blog.daniellobato.me
daniellobato.me

GPG: http://keys.gnupg.net/pks/lookup?op=get&search=0x7A92D6DD38D6DE30