Maurice, we have this too - I posted here originally (and some time ago!) 
- https://groups.google.com/d/msg/foreman-users/Xn3hAYL95QM/r1D22blTBgAJ

Our script(s):

- create lifecycles / locations / settings etc
- enable / sync RH repos
- create / sync custom repos (and add urls)
- create gpg keys
- create and assign sync plans
- create content view, publish version 1 and promote to all lifecycles
- create activation keys, assign subscriptions
- create / upload provisioning templates, partition tables etc
- creates hostgroups, assigns OSs to them
- allows for provisioning template lifecycle overrides per host groups etc
- sets parameters throughout

It's all heavily structured (and we nest a lot) and the input file is a big 
chunk of yaml. The api scripts are written in (bad) ruby - I'm not really a 
programmer! -  started originally RH professional services.



On Monday, August 15, 2016 at 6:12:35 AM UTC-4, Maurice Mouw 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].
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.

Reply via email to