Changes between Version 11 and Version 12 of GENIExperimenter/Tutorials/GENIExperimentEngine/Execute
- Timestamp:
- 03/13/15 16:29:36 (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GENIExperimenter/Tutorials/GENIExperimentEngine/Execute
v11 v12 26 26 '''!http://www.lively-web.org/nodejs/GEETutorial/helloWorld?slice=<slice name>&name=<container name>&ip=<IP of host>&local=<IP of container>&lat=<latitude of host>&lng=<longitude of container>''' 27 27 28 '''This page will log each of your queries, and you can check that all your nodes were successfully able to run the query.''' 29 28 30 We will work up to this goal through hands-on learning with Ansible. 29 31 … … 34 36 We will first get familiar with some basic Ansible commands using the command-line interface. 35 37 36 === 1.1The ping module ===38 === (a) The ping module === 37 39 38 40 The '''ping''' module simply tries to do a SSH login to a node and reports success or failure. Run the following command on your controller: … … 44 46 If you don’t see success everywhere then there is something wrong with your setup. Ask one of the tutorial leaders for help. 45 47 46 === 1.2The shell module ===48 === (b) The shell module === 47 49 48 50 The '''shell''' module lets you run arbitrary SSH commands in parallel across a set of hosts. It’s useful for poking around, or if there is no Ansible module with the functionality you need. Try it out: … … 54 56 You can replace ''hostname'' above with any other Linux command. 55 57 56 === 1.3The setup module ===58 === (c) The setup module === 57 59 58 60 The '''setup''' module gathers a bunch of information about each node and saves it in variables that you can reference in your Ansible playbooks. This will be really useful to do the tutorial! Try it out on a node to see what it collects (replace slice338 with your slicelet’s name): … … 64 66 == 2. Create an Ansible playbook to download a parameterized URL from each node == 65 67 66 === 2.1Create a starter Ansible playbook ===68 === (a) Create a starter Ansible playbook === 67 69 68 70 A playbook is a YAML file containing a list of Ansible commands. To get started creating your Ansible playbook, copy the following into a file called lab.yaml: … … 84 86 The '''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). 85 87 86 === 2.2Iteratively build your Ansible playbook ===88 === (b) Iteratively build your Ansible playbook === 87 89 88 90 Now, 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.