mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Rename 'successful' to 'contacted' ...
This commit is contained in:
parent
530e54b3e4
commit
7be8d134c9
2 changed files with 9 additions and 5 deletions
10
README.md
10
README.md
|
@ -75,7 +75,10 @@ Run a module by name with arguments
|
||||||
API Example
|
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
|
import ansible
|
||||||
runner = ansible.Runner(
|
runner = ansible.Runner(
|
||||||
|
@ -86,17 +89,18 @@ The API is simple and returns basic datastructures.
|
||||||
data = runner.run()
|
data = runner.run()
|
||||||
|
|
||||||
{
|
{
|
||||||
'successful' : {
|
'contacted' : {
|
||||||
'xyz.example.com' : [ 'any kind of datastructure is returnable' ],
|
'xyz.example.com' : [ 'any kind of datastructure is returnable' ],
|
||||||
'foo.example.com' : [ '...' ]
|
'foo.example.com' : [ '...' ]
|
||||||
},
|
},
|
||||||
'failed' : {
|
'dark' : {
|
||||||
'bar.example.com' : [ 'failure message' ]
|
'bar.example.com' : [ 'failure message' ]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Additional options to Runner include the number of forks, hostname
|
Additional options to Runner include the number of forks, hostname
|
||||||
exclusion pattern, library path, arguments, and so on.
|
exclusion pattern, library path, arguments, and so on.
|
||||||
|
|
||||||
Read the source, it's not complicated.
|
Read the source, it's not complicated.
|
||||||
|
|
||||||
Patterns
|
Patterns
|
||||||
|
|
|
@ -155,8 +155,8 @@ class Runner(object):
|
||||||
hosts = [ (self,x) for x in hosts ]
|
hosts = [ (self,x) for x in hosts ]
|
||||||
results = pool.map(_executor_hook, hosts)
|
results = pool.map(_executor_hook, hosts)
|
||||||
results2 = {
|
results2 = {
|
||||||
"successful" : {},
|
"contacted" : {},
|
||||||
"failed" : {}
|
"dark" : {}
|
||||||
}
|
}
|
||||||
for x in results:
|
for x in results:
|
||||||
(host, is_ok, result) = x
|
(host, is_ok, result) = x
|
||||||
|
|
Loading…
Reference in a new issue