aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYujun Zhang <zhang.yujunz@zte.com.cn>2016-11-23 16:02:35 +0800
committerYujun Zhang <zhang.yujunz@zte.com.cn>2016-11-23 16:34:17 +0800
commitd1e4062604fdf9ff97959e396f6be4aac2c33478 (patch)
treee6075ed1414551b3d93f1c43a96d9bf7f6101aed
parent07ee28b71118469f3946a009a126b7c21267173e (diff)
Reorganize the inventory
- update server name and spec - group servers by usage - assign roles for each group - rename role ssh to user Change-Id: Ibc0a599adfabee296510f140319889775d9ae6cc Signed-off-by: Yujun Zhang <zhang.yujunz@zte.com.cn>
-rw-r--r--opt/servers/dev.yml10
-rw-r--r--opt/servers/elk.yml5
-rw-r--r--opt/servers/inventory21
-rw-r--r--opt/servers/mongo.yml4
-rw-r--r--opt/servers/ngnix.yml4
-rw-r--r--opt/servers/qtip.yml4
-rw-r--r--opt/servers/roles/user/defaults/main.yml (renamed from opt/servers/roles/ssh/defaults/main.yml)0
-rw-r--r--opt/servers/roles/user/files/serena.authorized_keys (renamed from opt/servers/roles/ssh/files/serena.authorized_keys)0
-rw-r--r--opt/servers/roles/user/files/sudoers.d-qtip2
-rw-r--r--opt/servers/roles/user/files/taseer.authorized_keys (renamed from opt/servers/roles/ssh/files/taseer.authorized_keys)0
-rw-r--r--opt/servers/roles/user/files/yujunz.authorized_keys (renamed from opt/servers/roles/ssh/files/yujunz.authorized_keys)0
-rw-r--r--opt/servers/roles/user/files/zhifeng.authorized_keys (renamed from opt/servers/roles/ssh/files/zhifeng.authorized_keys)0
-rw-r--r--opt/servers/roles/user/tasks/main.yml (renamed from opt/servers/roles/ssh/tasks/main.yml)6
-rw-r--r--opt/servers/ssh.yml4
-rw-r--r--opt/servers/test.yml4
-rw-r--r--opt/servers/testapi.yml4
16 files changed, 28 insertions, 40 deletions
diff --git a/opt/servers/dev.yml b/opt/servers/dev.yml
new file mode 100644
index 00000000..2e0cca93
--- /dev/null
+++ b/opt/servers/dev.yml
@@ -0,0 +1,10 @@
+---
+- hosts: development
+ roles:
+ - user
+ - docker
+ - elk
+ - mongo
+ - nginx
+ - qtip
+ - testapi
diff --git a/opt/servers/elk.yml b/opt/servers/elk.yml
deleted file mode 100644
index e2696573..00000000
--- a/opt/servers/elk.yml
+++ /dev/null
@@ -1,5 +0,0 @@
----
-- hosts: elk-servers
- roles:
- - docker
- - elk
diff --git a/opt/servers/inventory b/opt/servers/inventory
index 65c6c35d..0a862caa 100644
--- a/opt/servers/inventory
+++ b/opt/servers/inventory
@@ -1,17 +1,8 @@
-qtip-dev ansible_host=dev.qtip.io
-qtip-test ansible_host=test.qtip.io
+desk ansible_host=desk.qtip.io # 2vCPU/4GiB/16GiB (AWS us-east-1a)
+table ansible_host=table.qtip.io # 1vCPU/1024MB/100Mbps/40GB (Aliyun Hongkong B)
-[elk-servers]
-qtip-dev
+[development]
+desk
-[ngnix-servers]
-qtip-dev
-
-[qtip-servers]
-qtip-dev
-
-[testapi-servers]
-qtip-dev
-
-[mongo-servers]
-qtip-dev
+[testing]
+table
diff --git a/opt/servers/mongo.yml b/opt/servers/mongo.yml
deleted file mode 100644
index e64c0c69..00000000
--- a/opt/servers/mongo.yml
+++ /dev/null
@@ -1,4 +0,0 @@
----
-- hosts: mongo-servers
- roles:
- - mongo
diff --git a/opt/servers/ngnix.yml b/opt/servers/ngnix.yml
deleted file mode 100644
index d57a5603..00000000
--- a/opt/servers/ngnix.yml
+++ /dev/null
@@ -1,4 +0,0 @@
----
-- hosts: ngnix-servers
- roles:
- - ngnix
diff --git a/opt/servers/qtip.yml b/opt/servers/qtip.yml
deleted file mode 100644
index f0ac3c4e..00000000
--- a/opt/servers/qtip.yml
+++ /dev/null
@@ -1,4 +0,0 @@
----
-- hosts: qtip-servers
- roles:
- - qtip
diff --git a/opt/servers/roles/ssh/defaults/main.yml b/opt/servers/roles/user/defaults/main.yml
index 41ee9853..41ee9853 100644
--- a/opt/servers/roles/ssh/defaults/main.yml
+++ b/opt/servers/roles/user/defaults/main.yml
diff --git a/opt/servers/roles/ssh/files/serena.authorized_keys b/opt/servers/roles/user/files/serena.authorized_keys
index 5cdbfe00..5cdbfe00 100644
--- a/opt/servers/roles/ssh/files/serena.authorized_keys
+++ b/opt/servers/roles/user/files/serena.authorized_keys
diff --git a/opt/servers/roles/user/files/sudoers.d-qtip b/opt/servers/roles/user/files/sudoers.d-qtip
new file mode 100644
index 00000000..e96d278a
--- /dev/null
+++ b/opt/servers/roles/user/files/sudoers.d-qtip
@@ -0,0 +1,2 @@
+# Group rules for qtip-contributors
+%qtip ALL=(ALL) NOPASSWD:ALL
diff --git a/opt/servers/roles/ssh/files/taseer.authorized_keys b/opt/servers/roles/user/files/taseer.authorized_keys
index 2efb95e8..2efb95e8 100644
--- a/opt/servers/roles/ssh/files/taseer.authorized_keys
+++ b/opt/servers/roles/user/files/taseer.authorized_keys
diff --git a/opt/servers/roles/ssh/files/yujunz.authorized_keys b/opt/servers/roles/user/files/yujunz.authorized_keys
index 83ed540d..83ed540d 100644
--- a/opt/servers/roles/ssh/files/yujunz.authorized_keys
+++ b/opt/servers/roles/user/files/yujunz.authorized_keys
diff --git a/opt/servers/roles/ssh/files/zhifeng.authorized_keys b/opt/servers/roles/user/files/zhifeng.authorized_keys
index 195cfdca..195cfdca 100644
--- a/opt/servers/roles/ssh/files/zhifeng.authorized_keys
+++ b/opt/servers/roles/user/files/zhifeng.authorized_keys
diff --git a/opt/servers/roles/ssh/tasks/main.yml b/opt/servers/roles/user/tasks/main.yml
index 48318485..b1b5be9b 100644
--- a/opt/servers/roles/ssh/tasks/main.yml
+++ b/opt/servers/roles/user/tasks/main.yml
@@ -1,6 +1,12 @@
- name: add group qtip
become: true
group: name=qtip state=present
+- name: add qtip to sudoers without password
+ become: true
+ file:
+ src: sudoers.d-qtip
+ dest: /etc/sudoers.d/50-qtip
+ mode: 0440
- name: add users for ssh access
become: true
user:
diff --git a/opt/servers/ssh.yml b/opt/servers/ssh.yml
deleted file mode 100644
index a7fbb1c0..00000000
--- a/opt/servers/ssh.yml
+++ /dev/null
@@ -1,4 +0,0 @@
----
-- hosts: all
- roles:
- - ssh
diff --git a/opt/servers/test.yml b/opt/servers/test.yml
new file mode 100644
index 00000000..549b7255
--- /dev/null
+++ b/opt/servers/test.yml
@@ -0,0 +1,4 @@
+---
+- hosts: testing
+ roles:
+ - user
diff --git a/opt/servers/testapi.yml b/opt/servers/testapi.yml
deleted file mode 100644
index 556284db..00000000
--- a/opt/servers/testapi.yml
+++ /dev/null
@@ -1,4 +0,0 @@
----
-- hosts: testapi-servers
- roles:
- - testapi