Over the past few months we've worked with Foreman in several different
projects and we'd like to share two of these projects, which might be useful to
you.
foreman-yml [1]
···
===============
Foreman-yml is a command line tool written in Python, which provides the
ability to define the whole Foreman configuration (OS, partitioning
templates, provisioning templates, etc.) in a simple and readable YAML file.
In comparison to the hammer-cli foreman-yml is able to resolve the object names
to its corresponding IDs. Meaning for example you can use the template names
when defining the operating system without having to worry about the IDs. This
also includes linking the corresponding objects, e.g. "check" the needed
partiton templates in the OS context.
Foreman Ansible playbook [2]
In addition we’ve created a Foreman Ansible playbook from scratch, which
currently offers the following features:
setup database (SQLite or MySQL)
setup webserver (plain nginx as a proxy or nginx-passenger)
setup isc-dhcp-server
setup TFTP server
setup foreman-proxy
setup Foreman including configuration (templates, hosts, domains, etc.)
The playbook shouldn’t replace the foreman-installer but rather provide an
alternative way to setup Foreman instances for Ansible-oriented environments,
which often do not include any Puppet servers at all.
Currently it doesn’t cover all the possible features of the foreman-installer
but on the other hand allows one to fully configure Foreman thanks to the
integrated foreman-yml tool.
We made sure the playbook runs on many different distributions:
Debian 7 & 8
Ubuntu 14.04 & 16.04
CentOS 6 & 7
Red Hat Enterprise Linux 6 & 7
For us this provides a nice and even more important reproducable way to deploy
hands-free installations of Foreman.
Both tools are freely available under the GPLv3 license and are hosted on
GitHub.
We hope some of you can make use of them and would love to hear your feedback.
Contributions are more than welcome!
> Hi there!
>
> Over the past few months we've worked with Foreman in several different
> projects and we'd like to share two of these projects, which might be useful to
> you.
>
> foreman-yml [1]
> ===============
> Foreman-yml is a command line tool written in Python, which provides the
> ability to define the whole Foreman configuration (OS, partitioning
> templates, provisioning templates, etc.) in a simple and readable YAML file.
> In comparison to the hammer-cli foreman-yml is able to resolve the object names
> to its corresponding IDs. Meaning for example you can use the template names
> when defining the operating system without having to worry about the IDs. This
> also includes linking the corresponding objects, e.g. "check" the needed
> partiton templates in the OS context.
>
> Foreman Ansible playbook [2]
> ============================
> In addition we've created a Foreman Ansible playbook from scratch, which
> currently offers the following features:
>
> * setup database (SQLite or MySQL)
> * setup webserver (plain nginx as a proxy or nginx-passenger)
> * setup isc-dhcp-server
> * setup TFTP server
> * setup foreman-proxy
> * setup Foreman including configuration (templates, hosts, domains, etc.)
>
> The playbook shouldn't replace the foreman-installer but rather provide an
> alternative way to setup Foreman instances for Ansible-oriented environments,
> which often do not include any Puppet servers at all.
>
> Currently it doesn't cover all the possible features of the foreman-installer
> but on the other hand allows one to fully configure Foreman thanks to the
> integrated foreman-yml tool.
>
> We made sure the playbook runs on many different distributions:
>
> * Debian 7 & 8
> * Ubuntu 14.04 & 16.04
> * CentOS 6 & 7
> * Red Hat Enterprise Linux 6 & 7
>
> For us this provides a nice and even more important reproducable way to deploy
> hands-free installations of Foreman.
>
> Both tools are freely available under the GPLv3 license and are hosted on
> GitHub.
Sorry to revive an old thread, see for reasons below.
> foreman-yml [1]
> ===============
> Foreman-yml is a command line tool written in Python, which provides the
> ability to define the whole Foreman configuration (OS, partitioning
> templates, provisioning templates, etc.) in a simple and readable YAML file.
> In comparison to the hammer-cli foreman-yml is able to resolve the object names
> to its corresponding IDs. Meaning for example you can use the template names
> when defining the operating system without having to worry about the IDs. This
> also includes linking the corresponding objects, e.g. "check" the needed
> partiton templates in the OS context.
I'm trying to move a lot of info from my 1.11 to 1.12 and later 1.13 and
thought I could try this out.
I'm trying this on a Centos-7, foreman-1.12.2 instance but I get the
dreaded ERROR cannot connect to Foreman-API.
Looking at production.log I see the calls to get the version number and
then the call to apidoc/v2.json with a HTTP status code of 200 so OK.
After that I get the error so the message is not what is really
happening. Trying a few things I noticed that ipdb and single stepping
through I saw a syntax error pass by but can't pinpoint where that is
coming from other then that is after the apidoc/v2.json call. Thats
about as much python experience I can throw at it
[…]llo/hammer-cli-csv
> Neat, thanks! I can see how foreman-yml is useful (we had
> https://github.com/Katello/hammer-cli-csv which did a similar thing via
> hammer).
Thanks for the feedback, really appreciated!
Oh, I should checkout the Katello namespace more often to not miss out some of
the tools.
By the way, foreman-yml also supports dumping the config into a YAML file, the
README update is currently pending.
> About the Ansible playbook - the installer doesn't necessarily install
> Puppet in for anything other than the installation itself, but I can see
> it's value, plus it's easier to understand for Ansible users I suppose.
> Good work! I hope you find https://github.com/theforeman/foreman_ansible
> and https://github.com/theforeman/foreman_ansible_inventory useful if
> you're in such an environment.
Thanks by the way for the new features in the foreman-ansible plugin. It's
great!
[…]
> I'm trying this on a Centos-7, foreman-1.12.2 instance but I get the
> dreaded ERROR cannot connect to Foreman-API.
> Looking at production.log I see the calls to get the version number and
> then the call to apidoc/v2.json with a HTTP status code of 200 so OK.
> After that I get the error so the message is not what is really
> happening. Trying a few things I noticed that ipdb and single stepping
> through I saw a syntax error pass by but can't pinpoint where that is
> coming from other then that is after the apidoc/v2.json call. Thats
> about as much python experience I can throw at it
[…]
Can you generate the apipie cache and please try again?
/usr/sbin/foreman-rake apipie:cache
Cheers
Michael
···
On Sat, 17 Sep 2016 13:16:01 +0200 jvandewege wrote: