summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzhihui wu <wu.zhihui1@zte.com.cn>2017-04-20 13:53:29 +0800
committerYujun Zhang <zhang.yujunz@zte.com.cn>2017-04-21 11:52:28 +0000
commit5bb3d7cbc15957c3f0e82f19568240600d0f6592 (patch)
treefe30b7f16d476f1a6791e083cfafc68692ab69ee
parenteb9ab80b8bb3c7a00ac1f5227f41b6495db603ec (diff)
correct document of module apex_generate_inventory
Change-Id: I10bfd526e377ae02d2f6cf6d60d82fbb175ac431 Signed-off-by: zhihui wu <wu.zhihui1@zte.com.cn>
-rw-r--r--qtip/ansible_library/modules/apex_generate_inventory.py25
1 files changed, 11 insertions, 14 deletions
diff --git a/qtip/ansible_library/modules/apex_generate_inventory.py b/qtip/ansible_library/modules/apex_generate_inventory.py
index 9621ba6e..7c6c3b63 100644
--- a/qtip/ansible_library/modules/apex_generate_inventory.py
+++ b/qtip/ansible_library/modules/apex_generate_inventory.py
@@ -28,6 +28,13 @@ description:
version_added: "2.2"
author: "Zhihui Wu"
options:
+ baremetal_info:
+ description:
+ - return value from "openstack baremetal node list
+ --fields instance_uuid properties provision_state --format json"
+ server_info:
+ description:
+ - return value from "openstack server list --format json"
notes:
requirements:
- Host 'apex-undercloud' is in ~/.ssh/config
@@ -40,7 +47,7 @@ ansible_facts:
type: dictionary
contains:
hosts:
- description: host grouped by hostname, cluster, role and manufacture
+ description: host grouped by role
type: dict
hosts_meta:
description: hosts meta data indexed by hostname
@@ -52,19 +59,9 @@ EXAMPLES = '''
- hosts: apex-undercloud
tasks:
- name: collect facts of apex hosts
- apex:
- - debug: var=hostvarsi
- - name: add compute node to ansible inventory
- add_host:
- name: "{{ hosts_meta[item]['ip'] }}"
- groups: compute
- ansible_user: root
- ansible_ssh_common_args: '-o StrictHostKeyChecking=No -o ProxyJump=apex-master'
- with_items: "{{ hosts.compute }}"
-- hosts: compute
- tasks:
- - name: check ssh connection
- ping:
+ apex_generate_inventory:
+ baremetal_info: "{{ baremetal_info.stdout | from_json }}"
+ server_info: "{{ server_info.stdout | from_json }}"
'''