Update readme of running with native `ansible-playbook` command 23/34623/4
authorYujun Zhang <zhang.yujunz@zte.com.cn>
Thu, 11 May 2017 12:03:33 +0000 (20:03 +0800)
committerYujun Zhang <zhang.yujunz@zte.com.cn>
Mon, 15 May 2017 15:02:06 +0000 (15:02 +0000)
Change-Id: Idd021dd6301c7ced7658460622ba4961b071c3c2
Signed-off-by: Yujun Zhang <zhang.yujunz@zte.com.cn>
docs/testing/developer/devguide/ansible.rst [moved from docs/testing/user/userguide/ansible.rst with 73% similarity]
docs/testing/developer/devguide/index.rst
docs/testing/user/userguide/index.rst
resources/ansible_roles/qtip-workspace/ansible.cfg
resources/ansible_roles/qtip-workspace/defaults/main.yml

similarity index 73%
rename from docs/testing/user/userguide/ansible.rst
rename to docs/testing/developer/devguide/ansible.rst
index ff2cb0a..ab2cb55 100644 (file)
@@ -7,42 +7,23 @@ Run with Ansible
 ****************
 
 QTIP benchmarking tasks are built upon `Ansible`_ playbooks and roles. If you are familiar with Ansible, it is possible
-to run it with ``ansible-playbook`` command.
+to run it with ``ansible-playbook`` command. And it is useful during development of ansible modules or testing roles.
 
 .. _Ansible: https://www.ansible.com/
 
 Create workspace
 ================
 
-There is a playbook in ``tests/integration`` used for creating a new workspace for QTIP benchmarking::
+There is a playbook in ``resources/ansible_roles/qtip-workspace`` used for creating a new workspace::
 
-    cd qtip/tests/integration
-    ansible-playbook workspace-create.yml
-
-You will be prompted for required information for the Pod under test::
-
-    (qtip) ➜  integration git:(master) ✗ ansible-playbook workspace-create.yml
-    name of the pod under test (used in reporting) [qtip-pod]:
-    scenario deployed in the pod: [default]:
-    installer type of the pod (apex|fuel|other) [fuel]:
-    master host/vm of the installer (accessible by `ssh <hostname>`): f5
-    workspace name (new directory will be created) [workspace]:
-
-    PLAY [localhost] ***************************************************************
-
-    TASK [qtip-workspace : generating workspace] ***********************************
-
-    PLAY RECAP *********************************************************************
-    localhost                  : ok=0    changed=0    unreachable=0    failed=0
-
-
-You may hit ``Enter`` to accept default value
+    cd resources/ansible_roles/qtip-workspace
+    ansible-playbook create.yml
 
 NOTE: if this playbook is moved to other directory, configuration in ``ansible.cfg`` needs to be updated accordingly.
 The ansible roles from QTIP, i.e. ``<path_of_qtip>/resources/ansible_roles`` must be added to ``roles_path`` in
 `Ansible configuration file`_. For example::
 
-    roles_path = ../../resources/ansible_roles
+    roles_path = ~/qtip/resources/ansible_roles
 
 .. _Ansible configuration file:
 
@@ -89,22 +70,45 @@ If several jumps are required to reach the master node, we may chain the jump ho
 
 NOTE: ``ProxyJump`` is equivalent to the long ``ProxyCommand`` option, but it is only available since OpenSSH 7.3
 
-Setup testing environment
--------------------------
+Automatic setup
+---------------
 
-Run the setup playbook to generate ansible inventory of system under test by querying the slave nodes from the installer
+#. Modify ``<workspace>/group_vars/all.yml`` to set installer information correctly
+#. Modify ``<workspace>/hosts`` file to set installer master host correctly
+#. Run the setup playbook to generate ansible inventory of system under test by querying the slave nodes from the installer
 master::
 
     cd workspace
     ansible-playbook setup.yml
 
-Currently, QTIP supports automatic discovery from `apex`_ and `fuel`_
-
 .. _apex: https://wiki.opnfv.org/display/apex
 .. _fuel: https://wiki.opnfv.org/display/fuel
 
 It will update the ``hosts`` and ``ssh.cfg``
 
+Currently, QTIP supports automatic discovery from `apex`_ and `fuel`_.
+
+Manual setup
+------------
+
+If your installer is not supported or you are
+testing hosts not managed by installer, you may add them manually in ``[compute]`` group in ``<workspace>/hosts``::
+
+    [compute:vars]
+    ansible_ssh_common_args=-F ./ssh.cfg
+
+    [compute]
+    node-2
+    node-4
+    node-6
+    node-7
+
+And ``ssh.cfg`` for ssh connection configuration::
+
+    Host node-5
+      HostName 10.20.5.12
+      User root
+
 Run the tests
 -------------
 
index bd25a5b..40baca9 100644 (file)
@@ -11,6 +11,7 @@ QTIP Developer Guide
    :maxdepth: 2
 
    overview.rst
+   ansible.rst
    arch.rst
    framework.rst
    cli.rst
index dd54e57..d0d555f 100644 (file)
@@ -12,7 +12,6 @@ QTIP User Guide
    :maxdepth: 2
 
    overview.rst
-   ansible.rst
    cli.rst
    api.rst
    compute.rst
index 7407590..872941b 100644 (file)
@@ -12,4 +12,4 @@
 # some basic default values...
 
 inventory      = hosts
-roles_path = ../../resources/ansible_roles
+roles_path = ../../ansible_roles
index 102a706..68dafbc 100644 (file)
@@ -17,4 +17,5 @@ installer_master_group:
 
 workspace: "workspace"
 qtip_package: ../../..
-qtip_cache: .qtip-cache
\ No newline at end of file
+qtip_cache: .qtip-cache
+cwd: .