How it works...

After we have run ansible-playbook, Ansible will execute docker-compose using the module docker_service and will map the host port 8080 to the container's port, 8080. Once the playbook has finished executing, we can browse localhost:8080, and our application will be ready.

Get Ansible 2 Cloud Automation Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.