summaryrefslogtreecommitdiff
path: root/GrootStream/1.0
diff options
context:
space:
mode:
Diffstat (limited to 'GrootStream/1.0')
-rw-r--r--GrootStream/1.0/grootstream/hosts2
-rw-r--r--GrootStream/1.0/grootstream/install.yml7
-rw-r--r--GrootStream/1.0/grootstream/role/defaults/main.yml9
-rw-r--r--GrootStream/1.0/grootstream/role/tasks/deploy.yml32
-rw-r--r--GrootStream/1.0/grootstream/role/tasks/main.yml8
-rw-r--r--GrootStream/1.0/grootstream/role/tasks/uninstall.yml10
-rw-r--r--GrootStream/1.0/grootstream/role/templates/groot-stream.sh.j24
-rw-r--r--GrootStream/1.0/grootstream/role/templates/grootstream.yaml.j221
-rw-r--r--GrootStream/1.0/grootstream/role/vars/main.yml5
9 files changed, 98 insertions, 0 deletions
diff --git a/GrootStream/1.0/grootstream/hosts b/GrootStream/1.0/grootstream/hosts
new file mode 100644
index 0000000..829ebb5
--- /dev/null
+++ b/GrootStream/1.0/grootstream/hosts
@@ -0,0 +1,2 @@
+[grootstream]
+192.168.45.102
diff --git a/GrootStream/1.0/grootstream/install.yml b/GrootStream/1.0/grootstream/install.yml
new file mode 100644
index 0000000..b95f26c
--- /dev/null
+++ b/GrootStream/1.0/grootstream/install.yml
@@ -0,0 +1,7 @@
+- hosts: grootstream
+ remote_user: root
+ roles:
+ - role
+ vars_files:
+ - role/vars/main.yml
+
diff --git a/GrootStream/1.0/grootstream/role/defaults/main.yml b/GrootStream/1.0/grootstream/role/defaults/main.yml
new file mode 100644
index 0000000..6734e27
--- /dev/null
+++ b/GrootStream/1.0/grootstream/role/defaults/main.yml
@@ -0,0 +1,9 @@
+#The default installation location
+deploy_dir: /data/olap
+
+#The default data storage location,use storing application data,logs and configuration files
+data_dir: /data/olap
+
+qgw_api: '{{ vrrp_instance.default.virtual_ipaddress }}'
+
+hos_api: '{{ vrrp_instance.oss.virtual_ipaddress }}'
diff --git a/GrootStream/1.0/grootstream/role/tasks/deploy.yml b/GrootStream/1.0/grootstream/role/tasks/deploy.yml
new file mode 100644
index 0000000..f1d4071
--- /dev/null
+++ b/GrootStream/1.0/grootstream/role/tasks/deploy.yml
@@ -0,0 +1,32 @@
+- name: check Jdk version
+ shell: source /etc/profile && java -version 2>&1 | grep {{ java_version }} | wc -l
+ ignore_errors: false
+ register: jdk_out
+
+- name: To terminate execution
+ fail:
+ msg: "JDK is not installed in the target cluster, please check!"
+ when: jdk_out.stdout != '2'
+ run_once: true
+ delegate_to: 127.0.0.1
+
+- name: Create groot package path:{{ deploy_dir }}
+ file:
+ state: directory
+ path: '{{ deploy_dir }}'
+
+- name: Unpack {{ groot_stream_version }}.zip to {{ deploy_dir }}/
+ unarchive:
+ src: 'files/{{ groot_stream_version }}.zip'
+ dest: '{{ deploy_dir }}/'
+
+- name: Copying config files
+ template:
+ src: '{{ item.src }}'
+ dest: '{{ item.dest }}'
+ mode: '{{ item.mode }}'
+ backup: false
+ with_items:
+ - { src: 'groot-stream.sh.j2', dest: '/etc/profile.d/groot-stream.sh', mode: '0755' }
+ - { src: 'grootstream.yaml.j2', dest: '{{ deploy_dir }}/{{ groot_stream_version }}/config/grootstream.yaml', mode: '0644' }
+
diff --git a/GrootStream/1.0/grootstream/role/tasks/main.yml b/GrootStream/1.0/grootstream/role/tasks/main.yml
new file mode 100644
index 0000000..0b02eb7
--- /dev/null
+++ b/GrootStream/1.0/grootstream/role/tasks/main.yml
@@ -0,0 +1,8 @@
+- block:
+ - include: uninstall.yml
+ - include: deploy.yml
+ when: (operation) == "install"
+
+- block:
+ - include: uninstall.yml
+ when: (operation) == "uninstall"
diff --git a/GrootStream/1.0/grootstream/role/tasks/uninstall.yml b/GrootStream/1.0/grootstream/role/tasks/uninstall.yml
new file mode 100644
index 0000000..e2ca97b
--- /dev/null
+++ b/GrootStream/1.0/grootstream/role/tasks/uninstall.yml
@@ -0,0 +1,10 @@
+- block:
+ - name: Ansible delete old /etc/profile.d/groot-stream.sh
+ file:
+ path: '/etc/profile.d/groot-stream.sh'
+ state: absent
+
+ - name: Ansible delete old {{ deploy_dir }}/{{ groot_stream_version }}
+ file:
+ path: '{{ deploy_dir }}/{{ groot_stream_version }}'
+ state: absent
diff --git a/GrootStream/1.0/grootstream/role/templates/groot-stream.sh.j2 b/GrootStream/1.0/grootstream/role/templates/groot-stream.sh.j2
new file mode 100644
index 0000000..716813b
--- /dev/null
+++ b/GrootStream/1.0/grootstream/role/templates/groot-stream.sh.j2
@@ -0,0 +1,4 @@
+#groot-stream
+export GROOT_HOME={{ deploy_dir }}/{{ groot_stream_version }}
+export PATH=$GROOT_HOME/bin:$PATH
+
diff --git a/GrootStream/1.0/grootstream/role/templates/grootstream.yaml.j2 b/GrootStream/1.0/grootstream/role/templates/grootstream.yaml.j2
new file mode 100644
index 0000000..d8a6c60
--- /dev/null
+++ b/GrootStream/1.0/grootstream/role/templates/grootstream.yaml.j2
@@ -0,0 +1,21 @@
+grootstream:
+ knowledge_base:
+ - name: tsg_asnlookup
+ type: asnlookup
+ properties:
+ fs_type: hos
+ fs_default_path: http://{{ qgw_api }}:9999/v1/knowledge_base?kb_id=
+ files:
+ - f9f6bc91-2142-4673-8249-e097c00fe1ea
+ - name: tsg_geoiplookup
+ type: geoiplookup
+ properties:
+ fs_type: hos
+ fs_default_path: http://{{ qgw_api }}:9999/v1/knowledge_base?kb_id=
+ files:
+ - 64af7077-eb9b-4b8f-80cf-2ceebc89bea9
+ - 004390bc-3135-4a6f-a492-3662ecb9e289
+ properties:
+ hos.path: http://{{ hos_api }}:9098/hos
+ hos.bucket.name.traffic_file: traffic_file_bucket
+ hos.bucket.name.troubleshooting_file: troubleshooting_file_bucket
diff --git a/GrootStream/1.0/grootstream/role/vars/main.yml b/GrootStream/1.0/grootstream/role/vars/main.yml
new file mode 100644
index 0000000..7ab3fbb
--- /dev/null
+++ b/GrootStream/1.0/grootstream/role/vars/main.yml
@@ -0,0 +1,5 @@
+#groot版本
+groot_stream_version: groot-stream-1.0
+
+#Jdk版本
+java_version: 1.8.0_73