JIRA:QTIP-111
Change-Id: I11c42c5d9033efeaf5b8525b1090c2d45a9597d8
Signed-off-by: zhifeng.jiang <jiang.zhifeng@zte.com.cn>
 Qtip restful api
 ****************
 
-You can get all the Qtip restful api by http://qtip_server_ip:5000/api/spec.html.
+You can get all the Qtip restful api by http://restful_api.qtip.openzero.net/api/spec.html.
 
 
 [ngnix-servers]
 qtip-dev
+
+[qtip-servers]
+qtip-dev
 
--- /dev/null
+---
+- hosts: qtip-servers
+  roles:
+    - qtip
 
 services:
   - { name: kibana, upstream: 'http://127.0.0.1:5601' }
   - { name: elastic, upstream: 'http://127.0.0.1:9200' }
+
+qtip_services:
+  - { name: restful_api, upstream: 'http://127.0.0.1:5000' }
 
   template: src={{ item }}.conf.j2 dest=/etc/nginx/sites-enabled/{{ item }}.conf
   with_items:
     - elk
+    - qtip
   notify:
     - restart nginx
 
--- /dev/null
+# {{ ansible_managed }}
+
+# servers
+#
+{% for service in qtip_services %}
+server {
+  listen 80;
+  listen 443 ssl;
+  server_name {{ service.name }}.qtip.openzero.net;
+  location / {
+    proxy_pass {{ service.upstream }};
+    sub_filter {{ service.upstream }}  'http://{{ service.name }}.qtip.openzero.net';
+    sub_filter_once off;
+    sub_filter_types text/html application/json;
+  }
+}
+{% endfor %}
 
--- /dev/null
+#!/bin/bash
+
+envs="INSTALLER_TYPE=fuel -e INSTALLER_IP=10.20.0.2 -e NODE_NAME=zte-pod1"
+docker run --name qtip -id -e $envs -p 5000:5000 opnfv/qtip
 
--- /dev/null
+---
+# TODO:change the script to docker_container.
+- name: setting up qtip
+  become: true
+  script: ../files/run_qtip_server.sh