Start qtip server in qtip-dev host and add the qtip restful api online url in docs. 83/23983/2
authorzhifeng.jiang <jiang.zhifeng@zte.com.cn>
Fri, 4 Nov 2016 13:30:02 +0000 (21:30 +0800)
committerzhifeng.jiang <jiang.zhifeng@zte.com.cn>
Mon, 7 Nov 2016 11:38:23 +0000 (19:38 +0800)
JIRA:QTIP-111

Change-Id: I11c42c5d9033efeaf5b8525b1090c2d45a9597d8
Signed-off-by: zhifeng.jiang <jiang.zhifeng@zte.com.cn>
docs/apidocs/qtip_restful_api.rst
supporting/servers/inventory
supporting/servers/qtip.yml [new file with mode: 0644]
supporting/servers/roles/ngnix/defaults/main.yml
supporting/servers/roles/ngnix/tasks/main.yml
supporting/servers/roles/ngnix/templates/qtip.conf.j2 [new file with mode: 0644]
supporting/servers/roles/qtip/files/run_qtip_server.sh [new file with mode: 0644]
supporting/servers/roles/qtip/tasks/main.yml [new file with mode: 0644]

index 3f3297d..06c0129 100644 (file)
@@ -7,4 +7,4 @@
 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.
index 1414fa7..74c04c4 100644 (file)
@@ -5,3 +5,6 @@ qtip-dev
 
 [ngnix-servers]
 qtip-dev
+
+[qtip-servers]
+qtip-dev
diff --git a/supporting/servers/qtip.yml b/supporting/servers/qtip.yml
new file mode 100644 (file)
index 0000000..f0ac3c4
--- /dev/null
@@ -0,0 +1,4 @@
+---
+- hosts: qtip-servers
+  roles:
+    - qtip
index 855fc7e..cb3b393 100644 (file)
@@ -2,3 +2,6 @@
 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' }
index 8673b3d..ec14685 100644 (file)
@@ -7,5 +7,6 @@
   template: src={{ item }}.conf.j2 dest=/etc/nginx/sites-enabled/{{ item }}.conf
   with_items:
     - elk
+    - qtip
   notify:
     - restart nginx
diff --git a/supporting/servers/roles/ngnix/templates/qtip.conf.j2 b/supporting/servers/roles/ngnix/templates/qtip.conf.j2
new file mode 100644 (file)
index 0000000..3a15c6b
--- /dev/null
@@ -0,0 +1,17 @@
+# {{ 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 %}
diff --git a/supporting/servers/roles/qtip/files/run_qtip_server.sh b/supporting/servers/roles/qtip/files/run_qtip_server.sh
new file mode 100644 (file)
index 0000000..0f5cafe
--- /dev/null
@@ -0,0 +1,4 @@
+#!/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
diff --git a/supporting/servers/roles/qtip/tasks/main.yml b/supporting/servers/roles/qtip/tasks/main.yml
new file mode 100644 (file)
index 0000000..b829279
--- /dev/null
@@ -0,0 +1,5 @@
+---
+# TODO:change the script to docker_container.
+- name: setting up qtip
+  become: true
+  script: ../files/run_qtip_server.sh