Sample scenario running on VMs.
You must install Ansible.
user:~$ mkvirtualenv ansibleve
(ansibleve) user:~$ pip install ansible
Furthermore, you will probably want to install Vagrant to run the script as it is. You can also change hosts file and use already existing machines.
This Ansible playbook will create the following environment:
- A sample base station.
- A sample sensor.
- A user client which access to the sensor data using the information provided by the base station.
To simply create these machines using Vagrant go to the root directory of this project and run:
vagrant up
After running this command, you will find:
Depending on you needs, you will need to follow one of the following instructions:
-
Do nothing. If you ran vagrant up and everything went smoothly, then everything should be installed and working.
-
Do all the magic. This option installs redis in the server and installs rstatus in all the machines whose performance wants to be measured.
ansible-playbook -vvvv -u vagrant --private-key=[private-key-location] -l 'local' -i hosts main.yml
-
Just deploy the base station's HTTP server (it serves the app through the port 5000).
ansible-playbook -vvvv -u vagrant --private-key=[private-key-location] -l 'local' -i hosts basestations.yml
-
Just deploy the sensor's HTTP server (it serves the app through the port 5000).
ansible-playbook -vvvv -u vagrant --private-key=[private-key-location] -l 'local' -i hosts sensors.yml