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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.