提交各组件部署Ansible剧本初版

This commit is contained in:
qidaijie
2024-01-18 15:35:33 +08:00
parent f0bd05d565
commit 0cc392df5c
262 changed files with 15927 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
[grootstream]
192.168.45.102

View File

@@ -0,0 +1,7 @@
- hosts: grootstream
remote_user: root
roles:
- role
vars_files:
- role/vars/main.yml

View File

@@ -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 }}'

View File

@@ -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' }

View File

@@ -0,0 +1,8 @@
- block:
- include: uninstall.yml
- include: deploy.yml
when: (operation) == "install"
- block:
- include: uninstall.yml
when: (operation) == "uninstall"

View File

@@ -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

View File

@@ -0,0 +1,4 @@
#groot-stream
export GROOT_HOME={{ deploy_dir }}/{{ groot_stream_version }}
export PATH=$GROOT_HOME/bin:$PATH

View File

@@ -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

View File

@@ -0,0 +1,5 @@
#groot版本
groot_stream_version: groot-stream-1.0
#Jdk版本
java_version: 1.8.0_73