summaryrefslogtreecommitdiffstats
path: root/supporting/servers
diff options
context:
space:
mode:
Diffstat (limited to 'supporting/servers')
-rw-r--r--supporting/servers/elk.yml1
-rw-r--r--supporting/servers/inventory7
-rw-r--r--supporting/servers/ngnix.yml4
-rw-r--r--supporting/servers/roles/docker/handlers/main.yml (renamed from supporting/servers/roles/elk/handlers/main.yml)4
-rw-r--r--supporting/servers/roles/docker/tasks/main.yml39
-rw-r--r--supporting/servers/roles/elk/tasks/main.yml50
-rw-r--r--supporting/servers/roles/ngnix/defaults/main.yml (renamed from supporting/servers/roles/elk/defaults/main.yml)0
-rw-r--r--supporting/servers/roles/ngnix/handlers/main.yml4
-rw-r--r--supporting/servers/roles/ngnix/tasks/main.yml11
-rw-r--r--supporting/servers/roles/ngnix/templates/elk.conf.j2 (renamed from supporting/servers/roles/elk/templates/elk.conf.j2)0
-rw-r--r--supporting/servers/roles/ssh/files/yujunz.authorized_keys2
11 files changed, 66 insertions, 56 deletions
diff --git a/supporting/servers/elk.yml b/supporting/servers/elk.yml
index 406ba93f..e2696573 100644
--- a/supporting/servers/elk.yml
+++ b/supporting/servers/elk.yml
@@ -1,4 +1,5 @@
---
- hosts: elk-servers
roles:
+ - docker
- elk
diff --git a/supporting/servers/inventory b/supporting/servers/inventory
index aa9388fe..1414fa7c 100644
--- a/supporting/servers/inventory
+++ b/supporting/servers/inventory
@@ -1,4 +1,7 @@
-qtip-dev ansible_host=qtip
+qtip-dev ansible_host=qtip.openzero.net
[elk-servers]
-qtip-dev \ No newline at end of file
+qtip-dev
+
+[ngnix-servers]
+qtip-dev
diff --git a/supporting/servers/ngnix.yml b/supporting/servers/ngnix.yml
new file mode 100644
index 00000000..d57a5603
--- /dev/null
+++ b/supporting/servers/ngnix.yml
@@ -0,0 +1,4 @@
+---
+- hosts: ngnix-servers
+ roles:
+ - ngnix
diff --git a/supporting/servers/roles/elk/handlers/main.yml b/supporting/servers/roles/docker/handlers/main.yml
index 46bd76c7..985f8d41 100644
--- a/supporting/servers/roles/elk/handlers/main.yml
+++ b/supporting/servers/roles/docker/handlers/main.yml
@@ -2,7 +2,3 @@
- name: starting docker service
become: true
service: name=docker state=started
-
-- name: restart nginx
- become: true
- service: name=nginx state=restarted
diff --git a/supporting/servers/roles/docker/tasks/main.yml b/supporting/servers/roles/docker/tasks/main.yml
new file mode 100644
index 00000000..881650dd
--- /dev/null
+++ b/supporting/servers/roles/docker/tasks/main.yml
@@ -0,0 +1,39 @@
+- 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
+ apt: pkg={{item}} state=installed
+ with_items:
+ - python-dev
+ - python-pip
+
+- name: install docker-py
+ pip:
+ name: docker-py
+
diff --git a/supporting/servers/roles/elk/tasks/main.yml b/supporting/servers/roles/elk/tasks/main.yml
index cc544be5..ed987f1a 100644
--- a/supporting/servers/roles/elk/tasks/main.yml
+++ b/supporting/servers/roles/elk/tasks/main.yml
@@ -1,43 +1,4 @@
---
-- 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
-
-- name: install pip
- apt:
- pkg:{{ item }} state=installed
- state: installed
- with_items:
- - python-dev
- - python-pip
-
-- name: install docker-py
- pip:
- name: docker-py
-
- name: pulling elasticsearch and kibana
become: true
docker_image: name={{ item }} state=present
@@ -59,14 +20,3 @@
image: kibana
published_ports: 5601:5601
links: esearch:elasticsearch
-
-- 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
- notify:
- - restart nginx
diff --git a/supporting/servers/roles/elk/defaults/main.yml b/supporting/servers/roles/ngnix/defaults/main.yml
index 855fc7ea..855fc7ea 100644
--- a/supporting/servers/roles/elk/defaults/main.yml
+++ b/supporting/servers/roles/ngnix/defaults/main.yml
diff --git a/supporting/servers/roles/ngnix/handlers/main.yml b/supporting/servers/roles/ngnix/handlers/main.yml
new file mode 100644
index 00000000..35585363
--- /dev/null
+++ b/supporting/servers/roles/ngnix/handlers/main.yml
@@ -0,0 +1,4 @@
+---
+- name: restart nginx
+ become: true
+ service: name=nginx state=restarted
diff --git a/supporting/servers/roles/ngnix/tasks/main.yml b/supporting/servers/roles/ngnix/tasks/main.yml
new file mode 100644
index 00000000..8673b3d2
--- /dev/null
+++ b/supporting/servers/roles/ngnix/tasks/main.yml
@@ -0,0 +1,11 @@
+---
+- 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
+ notify:
+ - restart nginx
diff --git a/supporting/servers/roles/elk/templates/elk.conf.j2 b/supporting/servers/roles/ngnix/templates/elk.conf.j2
index 271690e0..271690e0 100644
--- a/supporting/servers/roles/elk/templates/elk.conf.j2
+++ b/supporting/servers/roles/ngnix/templates/elk.conf.j2
diff --git a/supporting/servers/roles/ssh/files/yujunz.authorized_keys b/supporting/servers/roles/ssh/files/yujunz.authorized_keys
index 168979c3..83ed540d 100644
--- a/supporting/servers/roles/ssh/files/yujunz.authorized_keys
+++ b/supporting/servers/roles/ssh/files/yujunz.authorized_keys
@@ -1 +1,3 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC0o+WARhbI5DeZK9eiZKVprY3oQ910npo/EPFI9prfpN7zeF0UA4TwT9rqsrwFgRQeJkKvbDTOPt5Ox9vLIEnxT4PdirvrYNxtyJHHfbL4ZxKemYhBi2BA6CAbI3f9CR+dtbfOBxtTpXAj1Y5oA9y59o1hqHpuVmM8dBpcQt/ELdYCHZ0khxft5WaSOURsslTZN18bikVX9WHlKflVyRA8efxqzTZ4w5ufHl1Fv9i/G0u7iGbUtvlI8X7+Z+ePuysZhHKErQSGfv2NybDi+r8xM5hL2LYXxjAu0PV58olUl1SX40OY9yA2Yx+PVzIGhv6EQ8snUFnsoMy0ZIbQ+ysB yujunz@silver.mbp
+ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDs9VhmmGg0c7FTLMtoZlPue4N1DdSCh6r6YssmEY3e1GHPXJTGGTX7QKXEBlWd7EXq+uedwN+lU9C/FClwneP0M+4vprgqdmUcmlCoSI/RffQAymcuGbxvfptNcLpBApHn4C+e93H/5ryaypaG+6n8WtbDZDtvWgn2ZJY6hDdJSw6Y++C+zDI0QliTsrCHmnGnYcRuDWUNgaiERvW3cvpeF5duFJcDZ0NtMl2UjeGMYL0JU6YfIOIeeFwD0Su86Nf3RtoKF+RzO4LcrGLvywzM7C/iCncIdj6GZjpVBYnB5U6YUh8VqLjHVHjmjTpAjmsWcc8NnwNG9rHDbG6nrGWd yujunz@silver
+