Me and surroundings
Engine
- Java based
- Single instance
- No need for hypervisor
Recycle!!
Puppet
Finishes to configure the host once the base OS is
installed.
Foreman
Orchestrates at a high level the Foreman Proxy and
Puppet, used as external node classifier, stores the
hostgroup definitions.
Foreman Proxy
Orchestrates lower level services to allow PXE boot and
provides the kickstart scripts that run puppet for the
first time after installation.
foreman_reserve
Foreman plugin that adds host allocation capabilities to Foreman
https://rubygems.org/gems/foreman_reserve
python-foreman
Python bindings for the Foreman API (V1 for now...)
https://pypi.python.org/pypi/python-foreman/
Fabric
High level framework used directly by the user (in our case by jenkins) to wraps all the
previous tools in a sensible manner
http://fabric.readthedocs.org/
For info on how to do that you can check the nice documentation:
http://theforeman.org/manuals/1.4/index.html#4.4Provisioning
Where is it?
Gem:
https://rubygems.org/gems/foreman_reserve
Code:
https://github.com/david-caro/foreman_reserve
Foreman API provides 4 main method types, that allow you to execute the
most common operations.
index_*
Shows a list of all the objects that match with a littel information for further reference.
show_*
Shows detailed information about the given object.
create_*
Creates a new entry of the object with the passed information
update_*
Updates an already existent object with the given information.
In [35]: frm.create_hosts?
Type: instancemethod
String Form:<bound method Foreman.create_hosts of <foreman.client.Foreman object at
0x32150d0>>
File: Dynamically generated function. No source code available.
Definition: frm.create_hosts(self, host)
Docstring:
:param host[hostgroup_id]: type number., optional
:param host[architecture_id]: type number., required
:param host[sp_subnet_id]: type number., optional
:param host[subnet_id]: type number., optional
:param host[owner_id]: type number., optional
:param host: type Hash, required
:param host[host_parameters_attributes]: type Array, optional
:param host[name]: type String, required
:param host[model_id_id]: type number., optional
:param host[puppet_ca_proxy_id]: type number., optional
:param host[domain_id]: type number., required
:param host[mac]: type String, required
:param host[ip]: type String, required
:param host[operatingsystem_id]: type String, required
:param host[ptable_id]: type number., optional
:param host[image_id]: type number., optional
:param host[medium_id]: type number., optional
:param host[puppet_proxy_id]: type number., required
:param host[environment_id]: type String, required
You can also use the internal host id number or its name:
In [41]: frm.show_hosts(id=139) == frm.show_hosts(id='cinteg35.ci.lab.tlv.redhat.com')
Out[41]:
True
Ewww...
Ok that's nice, but you used one host and you specified it manually...
you cheater
Let's see a parallel execution of the previous task using Foreman to select the
hosts it will run on
The '-P' option enables the parallel execution, and the '-z' one is to select the
maximum size of the thread pool to use.
And that it started adding tasks once the pool started finishing the current ones
[3/2/5] finished, running, queued
[3/3/4] finished, running, queued
[3/4/3] finished, running, queued
But I don't care about that bull$=|, I'm using another non-ssh framework,
so just show me the code!
$ fab -d do.provision
Displaying detailed information for task 'do.provision':
As simple as:
foreman_reserve
Python-foreman
Improve api generation (the api capabilities were being extracted from the
autogenerated foreman docs, now foreman can expose the API structure in json
format so we can use that directly)
Proper testing
Add value outside mirroring the API (add some extra sugar to make it easier to use)
Fabric tasks
Migrate from ssh-based tasks to any other message oriented task execution
framework
David Caro cfgmgmtcamp.eu 2014 28
A word of possibilities
If they do not
-> Build your own, it's easy
If you have any other questions, ideas, complaints or just want to reach out you
can find me here:
By e-mail:
dcaroest at redhat.com, david.caro.estevez at gmail.com
IRC:
dcaro at #ovirt or #theforeman at freenode