Version 7 (modified by 9 years ago) (diff) | ,
---|
Get to Know GENI and SAVI
STEPS FOR EXECUTING EXERCISE
Your goal in this tutorial is to fetch a parameterized URL on each node of your slicelet:
http://www.lively-web.org/nodejs/GEETutorial/helloWorld?slice=<slice name>&name=<container name>&ip=<IP of host>&lat=<latitude of host>&lng=<longitude of container>
This page will log each of your queries, and you can check that all your nodes were successfully able to run the query.
You will use Ansible to do this.
1. Create an Ansible playbook to download a parameterized URL from each node
To solve the problems of this tutorial, you need to collect several pieces of information on each node: the container name, the IP of the host (i.e., the VM hosting the container), the IP of the container, and the latitude and longitude of the host. Three of these (the slice name, container name, and local IP) can be found from Ansible variables. Running a setup
command, as on the previous page, will show you the Ansible variables. Note that setup
is run automatically by Ansible, so when executing a playbook on a node that information is available. Look through the output from setup
, and you can identify
the variables you'll need. You then need to fetch a custom URL containing this information from each host.
Below is the skeleton Ansible playbook that you will need. To download this playbook to your client machine:
wget http://groups.geni.net/geni/attachment/wiki/GENIExperimenter/Tutorials/GENI-SAVI/Execute/gee-tutorial-solution.yaml
--- - hosts: nodes remote_user: root tasks: ### (a): Get the control host name ### - name: Dump control host name debug: # INSERT ARGUMENTS HERE ### (b): Get the host's public IP address ### - name: Get my public IP using 'dig +short' shell: # INSERT ARGUMENTS HERE register: public_ip - name: Dump public_ip variable debug: var=public_ip ### (c): Get the latitude and longitude for each node ### - name: Download GeoLiteCity DB get_url: # INSERT ARGUMENTS HERE - name: Unzip GeoLiteCity.dat.gz shell: gunzip -f GeoLiteCity.dat.gz - name: Run geoiplookup to get latitude shell: # INSERT ARGUMENTS HERE register: latitude - name: Dump latitude variable debug: var=latitude - name: Run geoiplookup to get longitude shell: # INSERT ARGUMENTS HERE register: longitude - name: Dump longitude variable debug: var=longitude ### (d): Fetch the parameterized URL ### - name: Dump the full URL, to make sure it looks OK debug: msg="http://www.lively-web.org/nodejs/GEETutorial/helloWorld?slice=# INSERT ARGUMENTS HERE" - name: Fetch the full URL shell: curl "http://www.lively-web.org/nodejs/GEETutorial/helloWorld?slice=# INSERT ARGUMENTS HERE"
2. Run the playbook
Once you have finished with Step 1, run your playbook against all the nodes in your slice!
3. Verify that your playbook worked as expected
Once you have completed the tutorial, you can check where you’ve said hello from at:
Choose your slicelet name from the drop-down and you should see pins in the map at the coordinates reported by the nodes!
Next: Teardown Experiment
Attachments (2)
-
gee-tutorial.yaml (1.4 KB) - added by 9 years ago.
Ansible playbook skeleton for fetching the parameterized URL
- gee-tutorial-solution.yaml (1.6 KB) - added by 9 years ago.
Download all attachments as: .zip