Changes between Version 12 and Version 13 of GENIExperimenter/Tutorials/GENIExperimentEngine/Execute


Ignore:
Timestamp:
03/13/15 16:35:15 (9 years ago)
Author:
acb@cs.princeton.edu
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GENIExperimenter/Tutorials/GENIExperimentEngine/Execute

    v12 v13  
    8686The '''setup''' module is run automatically at the beginning of a playbook to populate variables for each node.  The above playbook will dump the value of each node’s ''ansible_hostname'' variable.  To run the playbook on a single node, replace ''nodes'' with the name of one of your slice nodes (e.g., slice338.pcvm3-7.instageni.nps.edu).
    8787
    88 === (b) Iteratively build your Ansible playbook ===
    89 
    9088Now, think about how you are going 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.  You then need to fetch a custom URL containing this information from each host.
    9189
     
    9391
    9492|| [[Image(wiki:GENIExperimenter/Tutorials/Graphics:tip.png, nolink, 50px, bottom)]] || '''Pro Tip:''' Build your solution a piece at a time.  Each step is, basically: (1) run a command, (2) possibly extract the information from the output and register it in an Ansible variable ||
     93
     94=== (b) Get the container name ===
     95
     96Look at the variables collected by Ansible's setup module (step 1(c) above).  Find one that holds the container name.  Add a debug statement to your playbook, like the one in the starter playbook, to print out its value.
     97
     98=== (c) Get the container IP address ===
     99
     100Look at the variables collected by Ansible's setup module (step 1(c) above).  Find one that holds the container IP address.  Add a debug statement to your playbook, like the one in the starter playbook, to print out its value.
     101
     102=== (d) Get the host's public IP address ===
    95103
    96104For instance, how to get the host's IP address? 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.  There are a number of ways that you could discover the control address, including running '''dig +short''' on the host’s name (see if you can find a variable that contains this; HINT: you need it to SSH into the slicelet) or by running '''curl''' against a webserver that reports the client’s externally visible address.