summaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorMichael DeHaan <michael.dehaan@gmail.com>2012-03-02 04:10:47 +0100
committerMichael DeHaan <michael.dehaan@gmail.com>2012-03-02 04:10:47 +0100
commit847846af0e28ab597d83f8f7ab4aaf584e3c4e2e (patch)
tree652a9009c1fd62e0f44c2fae406a27491407777c /README.md
parentREADME/doc/example updates to go with group support and CLI option changes. (diff)
downloadansible-847846af0e28ab597d83f8f7ab4aaf584e3c4e2e.tar.xz
ansible-847846af0e28ab597d83f8f7ab4aaf584e3c4e2e.zip
-p has been replaced by a required option. Various docs changes.
Diffstat (limited to 'README.md')
-rw-r--r--README.md26
1 files changed, 13 insertions, 13 deletions
diff --git a/README.md b/README.md
index 75f9d6a3c8..63fe15b9de 100644
--- a/README.md
+++ b/README.md
@@ -66,22 +66,22 @@ Example:
192.168.10.52
When running ansible commands, specific hosts are addressed by wildcard or group name.
-The default pattern is '*', meaning all ansible hosts.
+This is required for all ansible commands.
- -p '*.example.com'
- -p 'atlanta;raleigh'
- -p 'database*;appserver*'
- -p '192.168.10.50;192.168.10.52'
+ '*.example.com'
+ 'atlanta;raleigh'
+ 'database*;appserver*'
+ '192.168.10.50;192.168.10.52'
Example: Massive Parallelism and Running Shell Commands
=======================================================
Reboot all web servers in Atlanta, 10 at a time:
- ssh-agent bash
- ssh-add ~/.ssh/id_rsa.pub
+ > ssh-agent bash
+ > ssh-add ~/.ssh/id_rsa.pub
- ansible -p "atlanta-web*" -f 10 -n command -a "/sbin/reboot"
+ > ansible atlanta -a "/sbin/reboot" -f 10
The -f 10 specifies the usage of 10 simultaneous processes.
@@ -98,15 +98,15 @@ them as template sources.
To just transfer a file directly to many different servers:
- ansible -n copy -a "/etc/hosts /tmp/hosts"
+ > ansible atlanta copy -a "/etc/hosts /tmp/hosts"
To use templating, first run the setup module to put the template variables you would
like to use on the remote host. Then use the template module to write the
files using the templates. Templates are written in Jinja2 format.
- ansible -p webservers -n setup -a "favcolor=red ntp_server=192.168.1.1"
- ansible -p webservers -n template -a "src=/srv/motd.j2 dest=/etc/motd"
- ansible -p webservers -n template -a "src=/srv/ntp.j2 dest=/etc/ntp.conf"
+ > ansible webservers -m setup -a "favcolor=red ntp_server=192.168.1.1"
+ > ansible webservers -m template -a "src=/srv/motd.j2 dest=/etc/motd"
+ > ansible webservers -m template -a "src=/srv/ntp.j2 dest=/etc/ntp.conf"
Need something like the fqdn in a template? If facter or ohai are installed, data from these projects
will also be made available to the template engine, using 'facter_' and 'ohai_' prefixes for each.
@@ -116,7 +116,7 @@ Example: Software Deployment From Source Control
Deploy your webapp straight from git
- ansible -p webservers -n git -a "repo=git://foo dest=/srv/myapp version=HEAD"
+ > ansible webservers -m git -a "repo=git://foo dest=/srv/myapp version=HEAD"
Other Modules
=============