touch up the example API code
This commit is contained in:
parent
ee95a5b0a4
commit
edb9683050
1 changed files with 3 additions and 1 deletions
|
@ -83,7 +83,8 @@ track of which hosts were successfully contacted seperately from hosts
|
||||||
that had communication problems. The format of the return, if successful,
|
that had communication problems. The format of the return, if successful,
|
||||||
is entirely up to the module.
|
is entirely up to the module.
|
||||||
|
|
||||||
import ansible
|
|
||||||
|
import ansible.runner
|
||||||
runner = ansible.runner.Runner(
|
runner = ansible.runner.Runner(
|
||||||
pattern='*',
|
pattern='*',
|
||||||
module_name='inventory',
|
module_name='inventory',
|
||||||
|
@ -91,6 +92,7 @@ is entirely up to the module.
|
||||||
)
|
)
|
||||||
data = runner.run()
|
data = runner.run()
|
||||||
|
|
||||||
|
data is a dictionary:
|
||||||
{
|
{
|
||||||
'contacted' : {
|
'contacted' : {
|
||||||
'xyz.example.com' : [ 'any kind of datastructure is returnable' ],
|
'xyz.example.com' : [ 'any kind of datastructure is returnable' ],
|
||||||
|
|
Loading…
Add table
Reference in a new issue