« Back to projectatomic.io
Ask Your Question

Ansible - run time docker configuration

asked 2014-05-22 07:37:40 +0000

Stephen gravatar image

One of the things I was contemplating is run time configuration of the docker images... When doing large scale server management Ansible has been the goto tool... it can be easily used to manage docker containers as well...

By not using entrypoint or run in the dockerfile but rather installing ansible and an ansible playbook specifically intended to setup the service at run time. You can then call the ansible playbook which will setup the services configuration file using an ansible template.. adding things to the configuration file like IP address, port and other environment variables.

Then when starting the container environment variables can be passed in which ansible will then parse into the services configuration file and then instruct systemd to start the service.

This is extremely useful in situations where you would want to deploy clusters of services like elasticsearch, influxdb, foundationdb, consul or etcd

for instance with influxdb, a single docker image can be used and maintained with the base configuration, environment variables are not natively supported by influxdb but the configuration needs to be changed to match the current IP of the docker container and the IPs of the other influxdb servers so it can join the cluster.

containers can fail and other nodes can take their place regardless of how the configuration needs to be changed because ansible handles this on the fly at startup time of the container.

Is there any reason you think this is not the ideal approach with Atomic and geard? If not can you give an example of performing a influxdb deployment of a 5 container setup on 5 hosts and configuring them to all cluster together over the link setup by geard IP tables

I think this will best help me wrap my head around proper use of geard for autoscaling and configuration of containers.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2014-05-22 22:55:10 +0000

Stephen gravatar image

just found something that seems like a better approach, light weight with no dependencies. can pull configuration from etcd or consul and apply changes to configuration via templates.


edit flag offensive delete link more

answered 2014-06-06 14:48:19 +0000

jzb gravatar image

So, you answered your own question? :-)

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Question Tools



Asked: 2014-05-22 07:37:40 +0000

Seen: 2,133 times

Last updated: Jun 06 '14