Re: [foreman-dev] Make container provisioning more like host provisioning?

2017-02-03 Thread Tom McKay
I don't mean building containers, I mean using prebuilt.

You're right that maybe it shouldn't be like provisioning but more like rex?

The use cases for me are:

1. Run short-lived container that performs some action. I wrap hammer into
a container, add a layer w/ credentials and apipie, then use that to rex
hammer commands against my server. Certainly not a use case for the
foreman-docker plugin.

2. Run long-lived container that provides a service. In my case I run solr
to provide a search engine to pulp's crane. Starting the container has
varied options (storage, etc.). After the container is running it needs to
be further configured, both inside the container and by accessing the api.
I wouldn't use foreman-docker for this unless I had some "provisioning
template" type actions available. This too is probably a better rex use
case, probably in combination with ansible. This is what I have done. I can
also add the ansible role while provisioning a new atomic host to host my
solr container.

3. Run long-lived multiple containers. The projectatomic.io atomic registry
(openshift) is a simple example of this. Certainly wouldn't use
foreman-docker to start the containers in a coordinated fashion. Really not
a great use case for foreman at all but if that's the tool at hand very
doable with rex (again in combination with ansible).

So yeah, maybe containers are nothing like provisioned hosts. :)

On Fri, Feb 3, 2017 at 8:33 AM, Ewoud Kohl van Wijngaarden <
ew...@kohlvanwijngaarden.nl> wrote:

> On Sun, Jan 29, 2017 at 12:54:48PM -0500, Tom McKay wrote:
> > The foreman-docker container provisioning is not as richly featured as
> host
> > provisioning and it has me thinking what I would do differently.
> >
> > For my case I needed to "docker run" the container and then "docker exec"
> > several commands, and finally curl against it to configure. What I ended
> up
> > doing, which worked beautifully, was to make an ansible role that
> > accomplished all this plus additional steps of modifying the atomic host
> > the container was running on. Magic!
> >
> > I did run into some issues and limitations with foreman-ansible plugin (I
> > had to run ansible manually outside foreman) but overall ansible is the
> > tool for the job.
> >
> > Looking at the ansible modules around docker it's clear that even if I
> had
> > a nice wizard, if that wizard ended up generating me a playbook that I
> > could further modify it would be awesome.
> >
> > I have very little knowledge of puppet and provisioning but I feel that
> > wiring ansible into the container provisioning might be a very powerful
> > introduction to ansible for foreman users.
> >
> > Is this a realistic idea?
>
> I'm wondering if it is a good idea. Containers should be stateless and I
> think what you're describing goes aginst that.
>
> For me the whole idea behind a docker container is that it's prebuilt.
> That's what Dockerfiles are for. In case you are describing building
> images, then I think Packer[1] does something similar to what you want.
>
> [1]: https://www.packer.io/docs/builders/docker.html
>
> --
> You received this message because you are subscribed to the Google Groups
> "foreman-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to foreman-dev+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"foreman-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to foreman-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [foreman-dev] Make container provisioning more like host provisioning?

2017-02-03 Thread Ewoud Kohl van Wijngaarden
On Sun, Jan 29, 2017 at 12:54:48PM -0500, Tom McKay wrote:
> The foreman-docker container provisioning is not as richly featured as host
> provisioning and it has me thinking what I would do differently.
> 
> For my case I needed to "docker run" the container and then "docker exec"
> several commands, and finally curl against it to configure. What I ended up
> doing, which worked beautifully, was to make an ansible role that
> accomplished all this plus additional steps of modifying the atomic host
> the container was running on. Magic!
> 
> I did run into some issues and limitations with foreman-ansible plugin (I
> had to run ansible manually outside foreman) but overall ansible is the
> tool for the job.
> 
> Looking at the ansible modules around docker it's clear that even if I had
> a nice wizard, if that wizard ended up generating me a playbook that I
> could further modify it would be awesome.
> 
> I have very little knowledge of puppet and provisioning but I feel that
> wiring ansible into the container provisioning might be a very powerful
> introduction to ansible for foreman users.
> 
> Is this a realistic idea?

I'm wondering if it is a good idea. Containers should be stateless and I
think what you're describing goes aginst that.

For me the whole idea behind a docker container is that it's prebuilt.
That's what Dockerfiles are for. In case you are describing building
images, then I think Packer[1] does something similar to what you want.

[1]: https://www.packer.io/docs/builders/docker.html

-- 
You received this message because you are subscribed to the Google Groups 
"foreman-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to foreman-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.