It's fine to use Ansible to build docker images, but I'm not sure it's a
good placement engine for deciding where containers run.

Ideally you should some set of software that is trying to be a "cloud"
manager for Docker.

>From what I've heard, maybe this is Flynn or Shipyard -- I don't know - I
haven't tried them.

Specifying it in Ansible just seems really rough, keeping manual lists of
what is running where that you have to start and/or remove.

Anyway, somewhat off topic for this list.

I'm waiting for their tech to evolve myself, then it will fit in closer to
the other cloud models, feeling more like other hypervisors.




On Sun, Jun 15, 2014 at 5:07 PM, Laurent PETIT <[email protected]>
wrote:

> Hello,
>
> I'm trying to figure out how to best stay declarative while being able to
> have my system properly reconfigure itself in the following situation:
>
> - I have a bunch of docker hosts
> - I have a bunch of docker containers. Each docker container hosts a
> service for a customer and is reachable from a specific subdomain of my
> company.
> - I have a frontal nginx container doing virtual hosting to redirect
> traffic for a specific container to its current host+port.
>
> So I have docker-hosts, and containers virtual hosts.
>
> I'd like to write the configuration so that I have entries for the virtual
> hosts, with a parameter specifying on which docker host they must be set.
>
> Now, if I move a docker container from docker host A to docker host B in
> the configuration, when I run the playbook I must ensure that the following
> is done:
>
> - if the docker container is currently running on host B (in the example
> it is running on host A), then stop the container on host A
> (to keep things simple, currently the containers data are in a centrally
> accessible place - from docker hosts - but I must ensure only one container
> at a time accesses the data - thus killing from A before starting from B).
> - start the container from B
> ( - Reconfigure nginx and restart if necessary -> not a problem atm)
>
> Do you have advices on how best to do this?
>
> My current idea involves:
> - creating entries in the inventory for each docker container virtualhost
> - for each virtualhost, finding through docker hosts facts analysis where
> it is running (if at all), and then removing it if running in another host
> than what the config currently states
>
> Does that make sense? Will it be easy to do? (still newbie here, so maybe
> not having the right grasp of what's easy or not with ansible)
>
> Thanks in advance,
>
> --
> Laurent
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" 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].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/abe41851-bcad-4dea-8211-1f9e40e9304d%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/abe41851-bcad-4dea-8211-1f9e40e9304d%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" 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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgyEPVeMUb77pnGWLE1wuigWmFqpncRT0YSeTz8DGMr%3DOw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to