Deploying a sample application
Let's deploy our phonebook application. Since DigitalOcean does not offer a managed database service, we will deploy the SQLite variant of our application. Since we are going to use dynamic inventory, we will create the playbook as follows:
--- - hosts: app roles: - phonebook
How to do it…
To execute the playbook, along with dynamic inventory, we should execute the following command:
$ ansible-playbook -i digital_ocean.py --become phonebook.yml
This command installs the phonebook on our droplet. We can leverage the load balancer and provide the IP address of the load balancer instead of the droplet. Keep in mind that we are using SQLite here, not MySQL; SQLite is not accessible over the network.