Foreman in Docker

Hello,

I am working on a Dockerfile that builds Foreman image. Tests with
installation from git are successful, I will publish a blog post about
that hopefully.

But installation from git (running on webrick currently) is maybe not
for production use, even in a container. So my idea is to prepare an
image that has Foreman pre-installed and pre-configured using our
installer.

There are couple of issues:

Our installation highly depends on FQDN, which is a problem in Docker
environment. During the building phase, hostname is set to container id
(a hash like f12fb45c90f5) and it has no domain. Unfortunately hostname
cannot be changed, docker prevents from that (it's a feature perhaps).
We currently check for fqdn presence and refuse to proceed without that.

My plan is to create a way to skip this check so we can skip this and
maybe override the facter fqdn to some dummy domain if needed. Why do we
need the FQDN in the first place?

When Docker user is executing downloaded image, there is an option (-h)
to give it a proper hostname (FQDN). Therefore my plan is to start
puppet installer again and redeploy all certificates and everything that
depends on the FQDN. Then apache2 httpd can be spawned.

I wonder what is the cleanest way of changing hostname, we have
something on our wiki, but I would like to be sure everything was
re-deployed correctly.

Opinions?

··· -- Later,

Lukas “lzap” Zapletal
irc: lzap #theforeman

If you can use nightly/1.4, then the new installer reset DB option would
be best as then it will re-populate all the settings, admin account,
proxy registration etc that use the hostname. Just wipe out
/var/lib/puppet/ssl and run the installer with the reset option and I
think it'll work.

··· On 11/12/13 20:15, Lukas Zapletal wrote: > Hello, > > I am working on a Dockerfile that builds Foreman image. Tests with > installation from git are successful, I will publish a blog post about > that hopefully. > > But installation from git (running on webrick currently) is maybe not > for production use, even in a container. So my idea is to prepare an > image that has Foreman pre-installed and pre-configured using our > installer. > > There are couple of issues: > > Our installation highly depends on FQDN, which is a problem in Docker > environment. During the building phase, hostname is set to container id > (a hash like f12fb45c90f5) and it has no domain. Unfortunately hostname > cannot be changed, docker prevents from that (it's a feature perhaps). > We currently check for fqdn presence and refuse to proceed without that. > > My plan is to create a way to skip this check so we can skip this and > maybe override the facter fqdn to some dummy domain if needed. Why do we > need the FQDN in the first place? > > When Docker user is executing downloaded image, there is an option (-h) > to give it a proper hostname (FQDN). Therefore my plan is to start > puppet installer again and redeploy all certificates and everything that > depends on the FQDN. Then apache2 httpd can be spawned. > > I wonder what is the cleanest way of changing hostname, we have > something on our wiki, but I would like to be sure everything was > re-deployed correctly. > > Opinions?


Dominic Cleal
Red Hat Engineering