Let us see the
service playbook in action:
cd ~/books-ms ansible-playbook /vagrant/ansible/service.yml \ -i /vagrant/ansible/hosts/prod \ --extra-vars "repo_dir=$PWD service_name=books-ms"
We run the playbook
service.yml with the inventory pointing to the
hosts/prod file and few extra variables. The first one is the
repo_dir with the value of the current directory (
$PWD). The second represents the name of the service we want to deploy (
books-ms). At the moment, we have only this service. If there would be more, they could all be deployed with this same playbook by changing the value of this variable.
We managed to have not only the fully automated deployment but also provisioning of the destination server. ...