I would +1 for the idea of using the CSV tools to upload a configuration.
I have tried to use the CSV files to rebuild a configuration from
scratch and it kind of works but needs some work to fill out the corner
cases.
The upside of using the CSV import is that it will be part of the code
base and should see fixes as the code changes over time.
It should be possible to build a generator to take your client
configuration and generate a set of CSV files.
Once you have the CSV files you can then run them against the hammer
interface and you have a fully configured system.
On 08/15/2016 08:21 AM, Tom McKay wrote:
There is a project to export and import via CSV files,
hammer-cli-csv[1]. Your contributions there, or just feedback, is welcome.
The foreman resources are not well covered or tested, but includes at
least initial support for the list below. Some but not all plugins are
included, such as remote execution's job templates.
activation_keys
architectures
compute_profiles
compute_resources
containers
content_hosts
content_views
content_view_filters
domains
export
host_collections
hosts
host_groups
import
installation_media
job_templates
lifecycle_environments
locations
operating_systems
organizations
partition_tables
products
provisioning_templates
puppet_environments
puppet_facts
puppet_reports
reports
roles
settings
smart_proxies
splice
subnets
subscriptions
sync_plans
users
[1] https://github.com/Katello/hammer-cli-csv
On Mon, Aug 15, 2016 at 6:11 AM, Maurice Mouw <[email protected]
<mailto:[email protected]>> wrote:
Hi,
I've been working on a project for a completely automated setup of
Foreman, this includes subnets, dns-zones, etc. I will not bore
you with the details but i've got this pretty much setup and it
works. The company I'm doing this project for uses configuration
files that describe what hosts should be setup with what details.
I've created a converter for these files that enables me to import
this data using the REST API. This again works well no troubles.
Now this is basically the initial setup, after the import is done
I do not want to use these old configuration files but something
structured for example in JSON. So I was thinking of writing a
script that extracts all the (JSON) data that I want to a file.
Than it needs to be possible to reinstall the Foreman server and
import the file again using a script. After the import is done I
should basically be able to deploy nodes again as if nothing
happened. For now the JSON file should include an organization,
multiple locations, multiple hostgroup, multiple subnets, one or
more domains, the hosts and all the parameters defined in Foreman.
Everything will be linked to a organization.Than my questions:
* Is setting up on or more scripts for this a viable way for
doing this?
* Is there more efficient way of doing this (maybe this is
easier using the hammer cli or just extracting it out of the
database)?
* Is there anybody out there already doing something similar, if
so how?
* Are there people interested in a setup like this?
I would assume Foreman being written in ruby that this would be
the best language to do it in. Unfortunately I'm not very
proficient in ruby and will most likely do this in either python
or PHP.
--
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 [email protected]
<mailto:[email protected]>.
To post to this group, send email to
[email protected]
<mailto:[email protected]>.
Visit this group at https://groups.google.com/group/foreman-users
<https://groups.google.com/group/foreman-users>.
For more options, visit https://groups.google.com/d/optout
<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 [email protected]
<mailto:[email protected]>.
To post to this group, send email to [email protected]
<mailto:[email protected]>.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.
--
Alvin Starr || voice: (905)513-7688
Netvel Inc. || Cell: (416)806-0133
[email protected] ||
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.