提交各组件部署Ansible剧本初版
This commit is contained in:
2
GrootStream/1.0/grootstream/hosts
Normal file
2
GrootStream/1.0/grootstream/hosts
Normal file
@@ -0,0 +1,2 @@
|
||||
[grootstream]
|
||||
192.168.45.102
|
||||
7
GrootStream/1.0/grootstream/install.yml
Normal file
7
GrootStream/1.0/grootstream/install.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
- hosts: grootstream
|
||||
remote_user: root
|
||||
roles:
|
||||
- role
|
||||
vars_files:
|
||||
- role/vars/main.yml
|
||||
|
||||
9
GrootStream/1.0/grootstream/role/defaults/main.yml
Normal file
9
GrootStream/1.0/grootstream/role/defaults/main.yml
Normal 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 }}'
|
||||
32
GrootStream/1.0/grootstream/role/tasks/deploy.yml
Normal file
32
GrootStream/1.0/grootstream/role/tasks/deploy.yml
Normal 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' }
|
||||
|
||||
8
GrootStream/1.0/grootstream/role/tasks/main.yml
Normal file
8
GrootStream/1.0/grootstream/role/tasks/main.yml
Normal file
@@ -0,0 +1,8 @@
|
||||
- block:
|
||||
- include: uninstall.yml
|
||||
- include: deploy.yml
|
||||
when: (operation) == "install"
|
||||
|
||||
- block:
|
||||
- include: uninstall.yml
|
||||
when: (operation) == "uninstall"
|
||||
10
GrootStream/1.0/grootstream/role/tasks/uninstall.yml
Normal file
10
GrootStream/1.0/grootstream/role/tasks/uninstall.yml
Normal 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
|
||||
@@ -0,0 +1,4 @@
|
||||
#groot-stream
|
||||
export GROOT_HOME={{ deploy_dir }}/{{ groot_stream_version }}
|
||||
export PATH=$GROOT_HOME/bin:$PATH
|
||||
|
||||
@@ -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
|
||||
5
GrootStream/1.0/grootstream/role/vars/main.yml
Normal file
5
GrootStream/1.0/grootstream/role/vars/main.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
#groot版本
|
||||
groot_stream_version: groot-stream-1.0
|
||||
|
||||
#Jdk版本
|
||||
java_version: 1.8.0_73
|
||||
Reference in New Issue
Block a user