Changes between Version 10 and Version 11 of GENIExperimenter/Tutorials/AnsibleHelloGENI/Execute
- Timestamp:
- 03/15/15 16:09:34 (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GENIExperimenter/Tutorials/AnsibleHelloGENI/Execute
v10 v11 77 77 }}} 78 78 79 On your local machine: 79 80 `apt` module is used to installed packages: 81 {{{ 82 #!sh 83 ansible [-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 89 ansible [-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 94 ansible [-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: 80 97 81 98 {{{ 82 99 #!sh 83 ansible -i inventory all -s -m apt -a "name=apache2 update_cache=yes"100 ansible [-i inventory] [all/server/client] -s -m synchronize -a "src=website/index.html dest=/var/www" 84 101 }}} 102 `lineinfile` module is used to see if an arbitrary line exists in a file: 85 103 {{{ 86 104 #!sh 87 ansible -i inventory server -s -a "/usr/sbin/a2enmod status"105 ansible [-i inventory] [all/server/client] -s -m lineinfile -a "line='ExtendedStatus On' dest=/etc/apache2/conf.d/extendedstatus create=yes state=present" 88 106 }}} 107 `service` module is used to start/stop/restart/etc services: 89 108 {{{ 90 109 #!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" 110 ansible [-i inventory] [all/server/client] -s -m service -a "name=apache2 state=restarted" 104 111 }}} 105 112 }}}