Changes between Version 1 and Version 2 of GENIExperimenter/Tutorials/GENIExperimentEngine/DesignSetup


Ignore:
Timestamp:
03/10/15 11:20:31 (9 years ago)
Author:
acb@cs.princeton.edu
Comment:

--

Legend:

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

    v1 v2  
    4242== Learn basic concepts of Ansible ==
    4343
     44Ansible (http://docs.ansible.com) is a free, open-source, intuitive IT automation tool that is well-suited to the tasks in this tutorial.  Ansible commands can be run from the command line or put in a YAML file called a ''playbook''.  We will be creating an Ansible playbook to run the parameterized HTTP query described earlier.
     45
     46Two basic concepts in Ansible are ''inventories'' and ''modules''.  An inventory is a list of hosts to be managed by Ansible, organized into groups.  When you run Ansible commands, either from the command-line or in a playbook, you specify the host group that the command should operate on.  In this way Ansible commands can operate on many hosts in parallel.  Take a look at the Ansible inventory in your '''ansible-hosts''' file.  This is basically the equivalent of the '''ssh-config''' except its specialized for Ansible.
     47
     48A command consists of a module and some arguments for the module.  A module provides a declarative abstraction on top of standard shell commands.  So for example, in the shell on an Ubuntu machine you might install package “foo” like this:
     49
     50{{{
     51$ sudo apt-get update
     52$ sudo apt-get install foo
     53}}}
     54
     55An equivalent Ansible command in a playbook would look like:
     56
     57{{{
     58apt: name=foo state=latest update_cache=yes
     59}}}
     60
     61The command uses the '''apt''' module, and tells Ansible: “Make sure the latest version of package foo is installed”.  There are many other modules which are well-documented at http://docs.ansible.com.
     62
    4463== Configure the Ansible controller for your slicelet ==
    4564
     65If you already have Ansible installed on your laptop, then you can use it as the controller for this experiment.  Otherwise, you will use one of the nodes in your slicelet as the Ansible controller.  Pick one, log into it, and install ansible using apt-get:
     66
     67{{{
     68$ apt-get update
     69$ apt-get install ansible
     70}}}
     71
     72Then upload your slicelet helper files to that node.  '''Pro Tip:''' remove your controller node from the '''ansible_hosts''' file after you’ve uploaded.
     73
    4674= [wiki:GENIExperimenter/Tutorials/GENIExperimentEngine/Execute Next: Run Experiment] =