Changes between Version 10 and Version 11 of GENIExperimenter/Tutorials/AnsibleHelloGENI/Execute


Ignore:
Timestamp:
03/15/15 16:09:34 (9 years ago)
Author:
sedwards@bbn.com
Comment:

--

Legend:

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

    v10 v11  
    7777}}}
    7878
    79 On your local machine:
     79
     80`apt` module is used to installed packages:
     81   {{{
     82#!sh
     83ansible [-i inventory] [all/server/client] -s -m apt -a "name=apache2 update_cache=yes"
     84   }}}
     85
     86`shell` module is used to execute an arbitrary shell command:
     87   {{{
     88#!sh
     89ansible [-i inventory] [all/server/client]  -s -m shell -a "/usr/sbin/a2enmod status"
     90   }}}
     91`file` module is used to manipulate files:
     92   {{{
     93#!sh
     94ansible [-i inventory] [all/server/client] -s -m file -a "path=/var/www/html state=absent"
     95   }}}
     96`synchronize` module is an implementation of `rsync` and is used to efficiently synchronize files between your local machine and the node:
    8097
    8198   {{{
    8299#!sh
    83 ansible -i inventory all -s -m apt -a "name=apache2 update_cache=yes"
     100ansible [-i inventory] [all/server/client] -s  -m synchronize -a "src=website/index.html dest=/var/www"
    84101   }}}
     102`lineinfile` module is used to see if an arbitrary line exists in a file:
    85103   {{{
    86104#!sh
    87 ansible -i inventory server -s  -a "/usr/sbin/a2enmod status"
     105ansible [-i inventory] [all/server/client] -s  -m lineinfile -a "line='ExtendedStatus On' dest=/etc/apache2/conf.d/extendedstatus create=yes state=present"
    88106   }}}
     107`service` module is used to start/stop/restart/etc services:
    89108   {{{
    90109#!sh
    91 ansible -i inventory server -s -m file -a "path=/var/www/html state=absent"
    92    }}}
    93    {{{
    94 #!sh
    95 ansible -i inventory server -s  -m synchronize -a "src=website/index.html dest=/var/www"
    96    }}}
    97    {{{
    98 #!sh
    99 ansible -i inventory server -s  -m lineinfile -a "line='ExtendedStatus On' dest=/etc/apache2/conf.d/extendedstatus create=yes state=present"
    100    }}}
    101    {{{
    102 #!sh
    103 ansible -i inventory server -s  -m service -a "name=apache2 state=restarted"
     110ansible [-i inventory] [all/server/client] -s  -m service -a "name=apache2 state=restarted"
    104111   }}}
    105112}}}