Commit 7be8d134 by Michael DeHaan

Rename 'successful' to 'contacted' ...

parent 530e54b3
......@@ -75,7 +75,10 @@ Run a module by name with arguments
API Example
===========
The API is simple and returns basic datastructures.
The API is simple and returns basic datastructures. Ansible will keep
track of which hosts were successfully contacted seperately from hosts
that had communication problems. The format of the return, if successful,
is entirely up to the module.
import ansible
runner = ansible.Runner(
......@@ -86,17 +89,18 @@ The API is simple and returns basic datastructures.
data = runner.run()
{
'successful' : {
'contacted' : {
'xyz.example.com' : [ 'any kind of datastructure is returnable' ],
'foo.example.com' : [ '...' ]
},
'failed' : {
'dark' : {
'bar.example.com' : [ 'failure message' ]
}
}
Additional options to Runner include the number of forks, hostname
exclusion pattern, library path, arguments, and so on.
Read the source, it's not complicated.
Patterns
......
......@@ -155,8 +155,8 @@ class Runner(object):
hosts = [ (self,x) for x in hosts ]
results = pool.map(_executor_hook, hosts)
results2 = {
"successful" : {},
"failed" : {}
"contacted" : {},
"dark" : {}
}
for x in results:
(host, is_ok, result) = x
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment