Changes between Version 3 and Version 4 of GENIExperimenter/Tutorials/GENI-SAVI/Execute
- Timestamp:
- 05/26/15 12:00:33 (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GENIExperimenter/Tutorials/GENI-SAVI/Execute
v3 v4 26 26 '''Your goal in this tutorial is to fetch a parameterized URL on each node of your slicelet:''' 27 27 28 '''!http://www.lively-web.org/nodejs/GEETutorial/helloWorld?slice=<slice name>&name=<container name>&ip=<IP of host>&l ocal=<IP of container>&lat=<latitude of host>&lng=<longitude of container>'''28 '''!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>''' 29 29 30 30 '''This page will log each of your queries, and you can check that all your nodes were successfully able to run the query.''' … … 46 46 tasks: 47 47 48 ### (a): Get the container's FQDN ### 49 - name: Dump container FQDN 50 debug: # INSERT ARGUMENTS HERE 48 51 49 52 53 ### (b): Get the container IP address ### 54 - name: Dump container IP address 55 debug: # INSERT ARGUMENTS HERE 56 57 58 ### (c): Get the control host name ### 50 ### (a): Get the control host name ### 59 51 - name: Dump control host name 60 52 debug: # INSERT ARGUMENTS HERE 61 53 62 54 63 ### ( d): Get the host's public IP address ###55 ### (b): Get the host's public IP address ### 64 56 - name: Get my public IP using 'dig +short' 65 57 shell: # INSERT ARGUMENTS HERE … … 70 62 71 63 72 ### ( e): Get the latitude and longitude for each node ###64 ### (c): Get the latitude and longitude for each node ### 73 65 - name: Download GeoLiteCity DB 74 66 get_url: # INSERT ARGUMENTS HERE … … 92 84 93 85 94 ### ( f): Fetch the parameterized URL ###86 ### (d): Fetch the parameterized URL ### 95 87 - name: Dump the full URL, to make sure it looks OK 96 88 debug: msg="http://www.lively-web.org/nodejs/GEETutorial/helloWorld?slice=# INSERT ARGUMENTS HERE" … … 102 94 The following subsections provide further guidance on how to complete each step. 103 95 104 === (a) Get the container's FQDN ===105 96 106 Look at the variables collected by Ansible's '''setup''' module. Find one that holds the container's fully-qualified domain name (e.g., slice347.pcvm1-1.instageni.iu.edu) and dump it using a '''debug''' task. 107 108 === (b) Get the container IP address === 109 110 Look at the variables collected by Ansible's '''setup''' module. Find one that holds the container IP address and dump it using a '''debug''' task. 111 112 === (c) Get the control host name === 97 === (a) Get the control host name === 113 98 114 99 Look at the variables collected by Ansible's '''setup''' module. Find one that holds the control host's FQDN (HINT: it begins with ''pcvm'') and dump it using a '''debug''' task. You'll need this for the next step. 115 100 116 === ( d) Get the host's public IP address ===101 === (b) Get the host's public IP address === 117 102 118 103 The IP address visible inside the slicelet (as reported in the variable ''ansible_eth0.ipv4.address'') is a private address -- it is not the control address of the host. To discover the ''public'' IP address of the node, run '''dig +short <control host name>'''. … … 134 119 || [[Image(wiki:GENIExperimenter/Tutorials/Graphics:tip.png, nolink, 50px, bottom)]] || '''Pro Tip:''' When you run an Ansible command in a playbook, you can save the output into a new variable using '''register: varname''' Then you can retrieve the value later in the playbook using ''{{ varname }}'' or, for shell command output, ''{{ varname.stdout }}''. You can see an example of how to register a variable in [https://github.com/ansible/ansible-examples/blob/master/language_features/register_logic.yml this playbook]. || 135 120 136 === ( e) Get the latitude and longitude for each node ===121 === (c) Get the latitude and longitude for each node === 137 122 138 123 To map the host's control IP address obtained in the previous step to the latitude and longitude for each node, use the '''geoiplookup''' tool, provided by package '''geoip-bin'''. … … 148 133 || [[Image(wiki:GENIExperimenter/Tutorials/Graphics:tip.png, nolink, 50px, bottom)]] || '''Pro Tip:''' You can also use the Ansible '''script''' module to run arbitrary scripts in your slicelet, if that helps. See: http://docs.ansible.com/script_module.html || 149 134 150 === ( f) Fetch the parameterized URL ===135 === (d) Fetch the parameterized URL === 151 136 152 137 At this point, you should have enough information to fetch the parameterized URL in the playbook. You should first use a '''debug''' task to print out the URL to make sure that it's formatted correctly. … … 160 145 == 2. Run the playbook == 161 146 162 Once you have finished with Step 1, run your playbook against all the nodes in your slice let!147 Once you have finished with Step 1, run your playbook against all the nodes in your slice! 163 148 164 149 ----