From 23b627df622eeafafa215ce19764310c1d55dd55 Mon Sep 17 00:00:00 2001 From: Yujun Zhang Date: Sun, 8 Jan 2017 09:48:31 +0800 Subject: Reorganize the project folders Code from Brahmaputra is no longer maintained, including: - docker - playbooks - scripts - utils They are moved to legacy folder to avoid unnecessary confusion to new developers. Change-Id: Ia50383ca5c3bd82571eb7b2184e7f83e264ff8a7 Signed-off-by: Yujun Zhang --- opt/servers/ansible.cfg | 3 -- opt/servers/inventory | 4 --- opt/servers/roles/docker/handlers/main.yml | 4 --- opt/servers/roles/docker/tasks/main.yml | 41 ---------------------- opt/servers/roles/elk/tasks/main.yml | 22 ------------ opt/servers/roles/mongo/tasks/main.yml | 10 ------ opt/servers/roles/nginx/defaults/main.yml | 10 ------ opt/servers/roles/nginx/handlers/main.yml | 4 --- opt/servers/roles/nginx/tasks/main.yml | 13 ------- opt/servers/roles/nginx/templates/elk.conf.j2 | 14 -------- opt/servers/roles/nginx/templates/qtip.conf.j2 | 17 --------- opt/servers/roles/nginx/templates/testapi.conf.j2 | 17 --------- opt/servers/roles/qtip/files/run_qtip_server.sh | 4 --- opt/servers/roles/qtip/tasks/main.yml | 5 --- opt/servers/roles/testapi/files/run_testapi.sh | 4 --- opt/servers/roles/testapi/tasks/main.yml | 4 --- opt/servers/roles/user/defaults/main.yml | 7 ---- opt/servers/roles/user/files/akhil.authorized_keys | 1 - .../roles/user/files/serena.authorized_keys | 1 - opt/servers/roles/user/files/sudoers.d-qtip | 2 -- .../roles/user/files/taseer.authorized_keys | 1 - .../roles/user/files/yujunz.authorized_keys | 3 -- .../roles/user/files/zhifeng.authorized_keys | 1 - opt/servers/roles/user/tasks/main.yml | 35 ------------------ opt/servers/test.yml | 10 ------ 25 files changed, 237 deletions(-) delete mode 100644 opt/servers/ansible.cfg delete mode 100644 opt/servers/inventory delete mode 100644 opt/servers/roles/docker/handlers/main.yml delete mode 100644 opt/servers/roles/docker/tasks/main.yml delete mode 100644 opt/servers/roles/elk/tasks/main.yml delete mode 100644 opt/servers/roles/mongo/tasks/main.yml delete mode 100644 opt/servers/roles/nginx/defaults/main.yml delete mode 100644 opt/servers/roles/nginx/handlers/main.yml delete mode 100644 opt/servers/roles/nginx/tasks/main.yml delete mode 100644 opt/servers/roles/nginx/templates/elk.conf.j2 delete mode 100644 opt/servers/roles/nginx/templates/qtip.conf.j2 delete mode 100644 opt/servers/roles/nginx/templates/testapi.conf.j2 delete mode 100644 opt/servers/roles/qtip/files/run_qtip_server.sh delete mode 100644 opt/servers/roles/qtip/tasks/main.yml delete mode 100644 opt/servers/roles/testapi/files/run_testapi.sh delete mode 100644 opt/servers/roles/testapi/tasks/main.yml delete mode 100644 opt/servers/roles/user/defaults/main.yml delete mode 100644 opt/servers/roles/user/files/akhil.authorized_keys delete mode 100644 opt/servers/roles/user/files/serena.authorized_keys delete mode 100644 opt/servers/roles/user/files/sudoers.d-qtip delete mode 100644 opt/servers/roles/user/files/taseer.authorized_keys delete mode 100644 opt/servers/roles/user/files/yujunz.authorized_keys delete mode 100644 opt/servers/roles/user/files/zhifeng.authorized_keys delete mode 100644 opt/servers/roles/user/tasks/main.yml delete mode 100644 opt/servers/test.yml (limited to 'opt/servers') diff --git a/opt/servers/ansible.cfg b/opt/servers/ansible.cfg deleted file mode 100644 index 93022c4e..00000000 --- a/opt/servers/ansible.cfg +++ /dev/null @@ -1,3 +0,0 @@ -[defaults] -hostfile = inventory -host_key_checking = False \ No newline at end of file diff --git a/opt/servers/inventory b/opt/servers/inventory deleted file mode 100644 index 1ba1dc45..00000000 --- a/opt/servers/inventory +++ /dev/null @@ -1,4 +0,0 @@ -table ansible_host=table.qtip.io # 1vCPU/1024MB/100Mbps/40GB (Aliyun Hongkong B) - -[testing] -table diff --git a/opt/servers/roles/docker/handlers/main.yml b/opt/servers/roles/docker/handlers/main.yml deleted file mode 100644 index 985f8d41..00000000 --- a/opt/servers/roles/docker/handlers/main.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -- name: starting docker service - become: true - service: name=docker state=started diff --git a/opt/servers/roles/docker/tasks/main.yml b/opt/servers/roles/docker/tasks/main.yml deleted file mode 100644 index 1cf3bea0..00000000 --- a/opt/servers/roles/docker/tasks/main.yml +++ /dev/null @@ -1,41 +0,0 @@ -- name: adding keys - become: true - apt_key: keyserver=hkp://p80.pool.sks-keyservers.net id=0X58118E89F3A912897C070ADBF76221572C52609D - -- name: adding entry for ubuntu - become: true - apt_repository: repo='deb https://apt.dockerproject.org/repo ubuntu-xenial main' state=present filename='docker' - when: ansible_distribution == "Ubuntu" and ansible_distribution_version == "16.04" - -- name: installing from docker repo - become: true - shell: apt-cache policy docker-engine - when: ansible_distribution == "Ubuntu" and ansible_distribution_version== "16.04" - -- name: adding entry for ubuntu - become: true - apt_repository: repo='deb https://apt.dockerproject.org/repo ubuntu-trusty main' state=present filename='docker' - when: ansible_distribution == "Ubuntu" and ansible_distribution_version == "14.04" - -- name: updating - become: true - apt: update_cache=yes - -- name: installing docker engine - become: true - apt: name=docker-engine - notify: - - starting docker service - -- name: install pip - become: true - apt: name={{item}} state=installed - with_items: - - python-dev - - python-pip - -- name: install docker-py - become: true - pip: - name: docker-py - version: 1.7.0 diff --git a/opt/servers/roles/elk/tasks/main.yml b/opt/servers/roles/elk/tasks/main.yml deleted file mode 100644 index ed987f1a..00000000 --- a/opt/servers/roles/elk/tasks/main.yml +++ /dev/null @@ -1,22 +0,0 @@ ---- -- name: pulling elasticsearch and kibana - become: true - docker_image: name={{ item }} state=present - with_items: - - elasticsearch - - kibana - -- name: setting up elasticsearch - become: true - docker_container: - name: esearch - image: elasticsearch - published_ports: 9200:9200 - -- name: setting up kibana - become: true - docker_container: - name: kibana - image: kibana - published_ports: 5601:5601 - links: esearch:elasticsearch diff --git a/opt/servers/roles/mongo/tasks/main.yml b/opt/servers/roles/mongo/tasks/main.yml deleted file mode 100644 index 81fb49b5..00000000 --- a/opt/servers/roles/mongo/tasks/main.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -- name: pulling mongo - become: true - docker_image: name=mongo:3.2.1 state=present - -- name: setting up mongo - become: true - docker_container: - name: mongo - image: mongo:3.2.1 diff --git a/opt/servers/roles/nginx/defaults/main.yml b/opt/servers/roles/nginx/defaults/main.yml deleted file mode 100644 index cdd1d773..00000000 --- a/opt/servers/roles/nginx/defaults/main.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -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' } - -testapi_services: - - { name: testapi, upstream: 'http://127.0.0.1:8000' } diff --git a/opt/servers/roles/nginx/handlers/main.yml b/opt/servers/roles/nginx/handlers/main.yml deleted file mode 100644 index 35585363..00000000 --- a/opt/servers/roles/nginx/handlers/main.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -- name: restart nginx - become: true - service: name=nginx state=restarted diff --git a/opt/servers/roles/nginx/tasks/main.yml b/opt/servers/roles/nginx/tasks/main.yml deleted file mode 100644 index 5c78166c..00000000 --- a/opt/servers/roles/nginx/tasks/main.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- -- name: nginx is installed - become: true - package: name=nginx state=present -- name: qtip server configuration is generated - become: true - template: src={{ item }}.conf.j2 dest=/etc/nginx/sites-enabled/{{ item }}.conf - with_items: - - elk - - qtip - - testapi - notify: - - restart nginx diff --git a/opt/servers/roles/nginx/templates/elk.conf.j2 b/opt/servers/roles/nginx/templates/elk.conf.j2 deleted file mode 100644 index 271690e0..00000000 --- a/opt/servers/roles/nginx/templates/elk.conf.j2 +++ /dev/null @@ -1,14 +0,0 @@ -# {{ ansible_managed }} - -# servers -# -{% for service in services %} -server { - listen 80; - listen 443 ssl; - server_name {{ service.name }}.qtip.openzero.net; - location / { - proxy_pass {{ service.upstream }}; - } -} -{% endfor %} diff --git a/opt/servers/roles/nginx/templates/qtip.conf.j2 b/opt/servers/roles/nginx/templates/qtip.conf.j2 deleted file mode 100644 index 3a15c6ba..00000000 --- a/opt/servers/roles/nginx/templates/qtip.conf.j2 +++ /dev/null @@ -1,17 +0,0 @@ -# {{ 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/opt/servers/roles/nginx/templates/testapi.conf.j2 b/opt/servers/roles/nginx/templates/testapi.conf.j2 deleted file mode 100644 index 6a4d388b..00000000 --- a/opt/servers/roles/nginx/templates/testapi.conf.j2 +++ /dev/null @@ -1,17 +0,0 @@ -# {{ ansible_managed }} - -# servers -# -{% for service in testapi_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/opt/servers/roles/qtip/files/run_qtip_server.sh b/opt/servers/roles/qtip/files/run_qtip_server.sh deleted file mode 100644 index 0f5cafea..00000000 --- a/opt/servers/roles/qtip/files/run_qtip_server.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/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/opt/servers/roles/qtip/tasks/main.yml b/opt/servers/roles/qtip/tasks/main.yml deleted file mode 100644 index b8292791..00000000 --- a/opt/servers/roles/qtip/tasks/main.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -# TODO:change the script to docker_container. -- name: setting up qtip - become: true - script: ../files/run_qtip_server.sh diff --git a/opt/servers/roles/testapi/files/run_testapi.sh b/opt/servers/roles/testapi/files/run_testapi.sh deleted file mode 100644 index f9ba8387..00000000 --- a/opt/servers/roles/testapi/files/run_testapi.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -envs="mongodb_url=mongodb://mongo:27017/ -e api_port=8000 -e swagger_url=http://testapi.qtip.openzero.net" -docker run --name testapi --link mongo:mongo -p 8000:8000 -e $envs -d opnfv/testapi diff --git a/opt/servers/roles/testapi/tasks/main.yml b/opt/servers/roles/testapi/tasks/main.yml deleted file mode 100644 index 8ca91396..00000000 --- a/opt/servers/roles/testapi/tasks/main.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -- name: setting up testapi - become: true - script: ../files/run_testapi.sh diff --git a/opt/servers/roles/user/defaults/main.yml b/opt/servers/roles/user/defaults/main.yml deleted file mode 100644 index ef496dd4..00000000 --- a/opt/servers/roles/user/defaults/main.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -users: - - { name: yujunz, comment: "Yujun Zhang " } - - { name: taseer, comment: "Taseer Ahmed " } - - { name: serena, comment: "Serena Feng " } - - { name: zhifeng, comment: "Zhifeng Jiang" } - - { name: akhil, comment: "Akhil Batra