Sample program to deploy docker nginx container, restart existing container and to get the status of running contianers using ansible and Marathon API.
This application pulls latest docker nginx image from docker hub: https://hub.docker.com/_/nginx/ and starts container.
-
Command to check ansible syntax:
ansible-playbook main.yml --syntax-check -i inventory
-
Commands to execute playbook:
-
To restart and get the status of already running applications use:
ansible-playbook -v main.yml -i inventory --tags test-restart
-
To start nginx contianer:
ansible-playbook -v main.yml -i inventory --tags nginx