Changes between Version 5 and Version 6 of GENIExperimenter/Tutorials/GENIExperimentEngine/Execute
- Timestamp:
- 03/11/15 15:40:07 (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GENIExperimenter/Tutorials/GENIExperimentEngine/Execute
v5 v6 20 20 = STEPS FOR EXECUTING EXERCISE = 21 21 22 ---- 23 24 '''Your goal in this tutorial is to fetch a parameterized URL on each node of your slicelet:''' 25 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 28 We will work up to this goal through hands-on learning with Ansible. 29 30 ---- 31 22 32 == Experiment with various Ansible modules: ping, shell, setup == 23 33 24 Next, get familiar with some basic Ansible commands. 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:34 We will first get familiar with some basic Ansible commands using the command-line interface. 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: 25 35 26 36 {{{ … … 44 54 }}} 45 55 46 == Create an Ansible playbook to achieve the tutorial objective ==56 == Create an Ansible playbook to download a parameterized URL from each node == 47 57 48 58 First create a starter Ansible playbook. Recall that a playbook is a YAML file containing a list of Ansible commands. Copy the following into a file called lab.yaml: … … 66 76 '''Pro Tip:''' Solve the problem on one node in your slice first, then deploy your solution to the remaining nodes. One thing at a time 67 77 68 Now, think about how you are going to solve the problems of this tutorial. Recall that your goal is to fetch a parameterized URL on each node of your slicelet: 69 70 ''!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>'' 78 Now, think about how you are going to solve the problems of this tutorial. 71 79 72 80 For instance, 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, which is one piece of information you want. 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. … … 98 106 == Run the playbook == 99 107 100 Once you have finished your playbook, run it against all the nodes! 101 102 {{{ 103 $ ansible-playbook -i ansible-hosts --private-key id_rsa lab.yaml 104 }}} 105 106 Our Ansible playbook contained six commands (not including debug commands) and used the '''apt''', '''shell''', and '''get_url''' modules. 108 Once you have finished your playbook, run it against all the nodes! As a data point, our Ansible playbook contained six commands (not including debug commands) and used the '''apt''', '''shell''', and '''get_url''' modules. 107 109 108 110 = [wiki:GENIExperimenter/Tutorials/GENIExperimentEngine/Finish Next: Teardown Experiment] =