Add support for manually installed (not using installer) OPNFV pod 27/34827/1
authorYujun Zhang <zhang.yujunz@zte.com.cn>
Tue, 16 May 2017 07:13:14 +0000 (15:13 +0800)
committerYujun Zhang <zhang.yujunz@zte.com.cn>
Tue, 16 May 2017 07:13:47 +0000 (15:13 +0800)
Change-Id: I314882dd8a9e491f253f825a8da7ec4c91ed3321
Signed-off-by: Yujun Zhang <zhang.yujunz@zte.com.cn>
qtip/cli/commands/cmd_project.py
resources/ansible_roles/qtip-workspace/defaults/main.yml
resources/ansible_roles/qtip-workspace/files/template/group_vars/all.yml
resources/ansible_roles/qtip-workspace/files/template/hosts
resources/ansible_roles/qtip-workspace/files/template/run.yml
resources/ansible_roles/qtip-workspace/files/template/setup.yml
resources/ansible_roles/qtip-workspace/files/template/teardown.yml
resources/ansible_roles/qtip-workspace/files/template/templates/hosts

index 0bf7d82..42fd000 100644 (file)
@@ -37,8 +37,8 @@ def cli():
 
 @cli.command(help="Create new testing project")
 @click.option('--pod', default='unknown', help='Name of pod under test')
-@click.option('--installer', help='OPNFV installer', required=True)
-@click.option('--master-host', help='Installer hostname', required=True)
+@click.option('--installer', help='OPNFV installer', default='manual')
+@click.option('--master-host', help='Installer hostname', default='dummy-host')
 @click.option('--scenario', default='unknown', help='OPNFV scenario')
 @click.argument('name')
 def create(pod, installer, master_host, scenario, name):
index 68dafbc..7f6407d 100644 (file)
@@ -12,6 +12,7 @@ installer: fuel
 installer_master_host: fuel-master
 
 installer_master_group:
+  manual: dummy-group
   fuel: fuel-masters
   apex: apex-underclouds
 
index 2967f6e..3d41e1b 100644 (file)
@@ -14,6 +14,7 @@ qtip_dump: dump
 qtip_cache: "{{ qtip_cache }}"
 qtip_workdir: "{% raw %}{{ ansible_env.HOME }}{% endraw %}/qtip-workdir-{{ lookup('pipe', 'date +%Y%m%d-%H%M') }}"
 installer_master_group:
+  manual: dummy-group
   fuel: fuel-masters
   apex: apex-underclouds
 
index b8b4bbe..b8b256a 100644 (file)
@@ -1,4 +1,13 @@
 localhost   ansible_connection=local
 
+{% if installer != 'manual' %}
 [{{ installer_master_group[installer] }}]
 {{ installer_master_host }}
+{% else %}
+[SUT]
+# Add hosts in system under test, example::
+#
+#   host-1  ansible_host=192.168.10.1 ansible_host=22 ansile_user=root
+#
+# See http://docs.ansible.com/ansible/intro_inventory.html for details
+{% endif %}
\ No newline at end of file
index 9bb865d..f8e71f0 100644 (file)
   - { role: qtip, tasks: setup-local, tags: [setup] }
 
 
-- hosts: compute
+- hosts: SUT
 
   roles:
   # prepare environment
   - { role: qtip, tasks: setup-node, tags: [setup] }
 
 
-- hosts: compute
+- hosts: SUT
 
   roles:
   # run test and collect metrics
index a522d67..d165a9f 100644 (file)
 # Prepare connection to SUT (System Under Test)
 
 ---
-
-- hosts: [fuel-masters, apex-underclouds]
+{% if installer == 'manual' %}
+- hosts: localhost
+  gather_facts: no
+  tasks:
+    - debug: "msg='please add hosts to SUT group in `hosts` file manually.'"
+{% else %}
+- hosts: [{{ installer_master_group[installer] }}]
   gather_facts: no
   roles:
     - { role: qtip, tasks: generate-inventory }
+{% endif %}
index cd0b9a2..dc65993 100644 (file)
@@ -7,7 +7,7 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
 
-- hosts: compute
+- hosts: SUT
 
   roles:
   # teardown environment
index cbbfcfe..492651b 100644 (file)
@@ -4,12 +4,15 @@ localhost   ansible_connection=local
 [{{ installer_master_group[installer] }}]
 {{ installer_master_host }}
 
-[fuel-groups:children]
+[SUT]   # system under test
+compute
+
+[node-groups:children]
 {% for group in hosts|sort %}
 {{ group }}
 {% endfor %}
 
-[fuel-groups:vars]
+[node-groups:vars]
 ansible_ssh_common_args=-F ./ssh.cfg
 
 {% for group in hosts|sort %}
@@ -19,4 +22,4 @@ ansible_ssh_common_args=-F ./ssh.cfg
 {% endfor %}
 
 {% endfor %}
-{% endraw %}
\ No newline at end of file
+{% endraw %}