= [http://groups.geni.net/geni/wiki/GENIExperimenter/Tutorials/AnsibleHelloGENI Title of the Experiment] = {{{ #!html
Image Map
}}} == 4. Configure and Initialize == `omni` comes with a script, `readyToLogin` which finds the login information for nodes in your slice. As of `omni` version 2.8, it has an `--ansible-inventory` flag which generates the Ansible inventory, which is a flat file which tells ansible the name and login information for your nodes. {{{ #!div style="background: #ffd; border: 3px ridge; width: 800px;" On your local machine: {{{ #!python readyToLogin MYSLICE --useSliceAggregates --ansible-inventory -o cat inventory ansible all -m ping -i inventory }}} Here is example output of running these commands: {{{ #!sh $ readyToLogin ansible --useSliceAggregates --ansible-inventory -o Host info saved in inventory file: /Users/jdoe/projects/GENI/hellogeni/inventory $ cat inventory client ansible_ssh_host=pc3.instageni.clemson.edu ansible_ssh_port=33850 server ansible_ssh_host=pcvm3-6.instageni.clemson.edu $ ansible all -m ping -i inventory client | success >> { "changed": false, "ping": "pong" } server | success >> { "changed": false, "ping": "pong" } }}} }}} == 5. Execute Experiment == {{{ #!html
Tip You can download your certificate from your slice authority.
}}} {{{ #!div style="background: #ffd; border: 3px ridge; width: 800px;" On your local machine: {{{ #!sh ansible -i inventory all -s -m apt -a "name=apache2 update_cache=yes" ansible -i inventory server -s -a "/usr/sbin/a2enmod status" ansible -i inventory server -s -m file -a "path=/var/www/html state=absent" ansible -i inventory server -s -m synchronize -a "src=website/index.html dest=/var/www" ansible -i inventory server -s -m lineinfile -a "line='ExtendedStatus On' dest=/etc/apache2/conf.d/extendedstatus create=yes state=present" ansible -i inventory server -s -m service -a "name=apache2 state=restarted" }}} }}} == 6. Analyze Experiment == ---- = [wiki:GENIExperimenter/Tutorials/AnsibleHelloGENI Introduction/DesignSetup] = = [wiki:GENIExperimenter/Tutorials/AnsibleHelloGENI/Finish Next: Finish] =