summaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorMichael DeHaan <michael.dehaan@gmail.com>2012-02-28 06:10:49 +0100
committerMichael DeHaan <michael.dehaan@gmail.com>2012-02-28 06:10:49 +0100
commitca49676ef7ed0df87eab1d25653e37ddc27df963 (patch)
tree5fec10f172e772a5c64c70874c3a9eb4b2c579b0 /README.md
parentREADME.md revisions. (diff)
downloadansible-ca49676ef7ed0df87eab1d25653e37ddc27df963.tar.xz
ansible-ca49676ef7ed0df87eab1d25653e37ddc27df963.zip
Somehow lost the API docs. Put them back!
Diffstat (limited to 'README.md')
-rw-r--r--README.md31
1 files changed, 31 insertions, 0 deletions
diff --git a/README.md b/README.md
index 528384fefd..f9935e9511 100644
--- a/README.md
+++ b/README.md
@@ -157,6 +157,37 @@ To run a playbook:
ansible -r playbook.yml
+API
+===
+
+The Python API is pretty powerful.
+
+ import ansible.runner
+
+ runner = ansible.runner.Runner(
+ module_name='ping',
+ module_args='',
+ pattern='web*',
+ forks=10
+ )
+ datastructure = runner.run()
+
+And returns results per host, for hosts we could contact
+and also ones that we failed to contact.
+
+ {
+ "dark" : {
+ "web1.example.com" : "failure message"
+ }
+ "contacted" : {
+ "web2.example.com" : 1
+ }
+
+ }
+
+A module can return any type of JSON data it wants, so Ansible can
+be used as a framework to build arbitrary applications and very powerful
+scripts.
Future plans
============