提交各组件部署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,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