This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
zhangjianlong-galaxy-auto-d…/parcels/roles/init/dos-baseline/tasks/init_dos.yml
jianlong fd1b752d16 1. 新增自动检测安装ansible(本地yum源的方式实现)
2. storm替换flink(但是storm并未完全移除,可通过改变配置部署)
3. 新增dos定时任务和dos数据流
4. ck新增表, 服务镜像配置更新, druid新增任务/更新任务
2021-09-01 11:30:43 +08:00

58 lines
1.7 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

- name: check jdk 1.8_73
shell: source /etc/profile && java -version 2>&1 | grep 1.8.0_73 | wc -l
ignore_errors: false
register: jdk_out
- name: To terminate execution
fail:
msg: "检测到目标集群内存在JDK未安装节点请检查"
when: jdk_out.stdout != '2'
run_once: true
delegate_to: 127.0.0.1
- name: create dos-baseline package path:{{ install_path }}
file:
state: directory
path: '{{ install_path }}'
- name: get zookeeper_servers to ansible variable
set_fact: zookeeper_servers="{{groups.zookeeper[0]}},{{groups.zookeeper[1]}},{{groups.zookeeper[2]}}"
when: '(groups.zookeeper|length) == 3'
- name: get zookeeper_servers to ansible variable
set_fact: zookeeper_servers="{{groups.zookeeper[0]}},{{groups.zookeeper[1]}},{{groups.zookeeper[2]}},{{groups.zookeeper[3]}},{{groups.zookeeper[4]}}"
when: '(groups.zookeeper|length) >= 5'
- name: master_ip from ansible variable
set_fact: master_ip="{{groups.dos_baseline[0]}}"
- name: copy program pkg to destination:{{ master_ip }}
unarchive:
src: "{{ package_path }}/dos-baseline.tar.gz"
dest: "{{ install_path }}"
force: true
backup: yes
delegate_to: "{{ master_ip }}"
- name: copy configuration
template:
src: 'application.properties.j2'
dest: '{{ install_path }}/dos-baseline/application.properties'
mode: 0644
backup: yes
delegate_to: "{{ master_ip }}"
#- name: start dos-baseline
# shell: sh {{ install_path }}/dos-baseline/start.sh
# run_once: true
# delegate_to: "{{ master_ip }}"
- name: add crontab task to schedule dos-baseline
cron:
name: 'dos-baseline'
hour: "3"
weekday: "1"
job: '/bin/sh {{ install_path }}/dos-baseline/start.sh'
user: root
delegate_to: "{{ master_ip }}"