Sorry for the non-explicit title here's what I would like to achieve
- get my web application running with docker (one container for the database, one for the cache, one for the php-fpm + the code)
- in production as I don't have vagrant , I would like the standard ansible with the docker module to be able to provision the environment
- as my developers have linux machines and vagrant support docker as a provider I would like to have these docker containers directly running in our dev machines without a VM (as we have a lot of project, keeping one VM by project soon exhausts the RAM , and we need to halt/up machines often, especially in maintenance phase)
- we have some developers on Mac/Windows, so we still need vagrant to provide the abstraction layer "vagrant up" to have a brain-dead simple creation of dev environment.
I know how to use Vagrant+Ansible provisionning for one machine and I know how to use ansible with the docker module to create a full environment following the example in
http://docs.ansible.com/docker_module.html
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.provision :ansible do |ansible|
ansible.playbook = 'provisioning/site.yml'
ansible.extra_vars = app_vars
ansible.verbose = verbosity_arg
end
end
but then it will run inside a virtual machine
I know how to use Vagrant to create several machines in one vagrant file
Vagrant.configure(2) do |config|
config.vm.define :dbmachine do |dbmachine|
dbmachine.vm.provider = "docker" do |d|
...
end
end
config.vm.define :cachemachine do |cachemachine|
cachemachine.vm.provider = "docker" do |d|
...
end
end
end
But then in production/staging, as I don't have vagrant, I don't have anymore the things describing the architecture
So is there a way to combine these things together to meet my needs ?