Open bayeslearner opened 2 years ago
Hi @bayeslearner, I never noticed that option before. Like you, I cannot find any examples that use it. I will have to play around with it and see what it does.
In the mean time, I have a repo that I use in a Lab in my DevOps course, that has Vagrantfile
that spins up 3 Docker containers. One with ansible, and two bare Ubuntu containers. I then teach students to ssh
into the ansible container nd use it to configure the other two containers as if they were two remote VM's. Maybe something in the Vagrantfile
will give you some ideas because I could have used the Vagrant Ansible plug-in to configure all of the containers automatically (but that would defeat the learning experience of using ansible for my students) ;-)
Here is the lab: https://github.com/nyu-devops/lab-ansible
I will continue to investigate the compose_configuration
option of vagrant as time permits.
The documentation mentioned that instead of using docker, vagrant can also support docker-compose as a provider.
But maybe my understanding is incorrect, maybe it only means internally a docker-compose is used, but if one has multiple containers, they all have to be config-ed separately?
I'm confused and I can't find an example anywhere. You seemed to have looked into this, do you happen to know whether a docker-compose file can be used a provider?
If yes, can one do the following too? use shell provisioner with the containers defined inside the docker-compose file. How to refer those containers by vagrant names? enable ssh in the docker image; use ansible provisoner with the containers defined inside the docker-compse file. use the compose-configuration hash to merge with docker-compose file.