删除init_runtime role,使用tsg-os-provision role 代替其功能实现

This commit is contained in:
fumingwei
2021-05-31 09:52:55 +08:00
parent 57b3f943fc
commit 623af414ba
8 changed files with 0 additions and 218 deletions

View File

@@ -1,26 +0,0 @@
#!/bin/bash
config_path=/data/init_runtime/runtime.yml
hosts_path=/opt/tsg/init_runtime/hosts
init_runtime_path=/opt/tsg/init_runtime/tasks/init_runtime.yml
backup_path=/opt/tsg/init_runtime/tasks/backup_conf.yml
rollback_path=/opt/tsg/init_runtime/tasks/rollback_conf.yml
backup_exit_code=0
init_runtime_exit_code=0
rollback_exit_code=0
ansible-playbook -i ${hosts_path} ${backup_path}
backup_exit_code=$?
if [ $backup_exit_code -ne 0 ]; then
echo "Error: backup files failed,return code:${backup_exit_code}"
exit 1
fi
ansible-playbook -i ${hosts_path} ${init_runtime_path} -e "var_files_path=${config_path}"
init_runtime_exit_code=$?
if [ $init_runtime_exit_code -ne 0 ];then
exit 1
fi

View File

@@ -1,13 +0,0 @@
#!/bin/bash
backup_config_path=/data/init_runtime/backup/runtime.yml
hosts_path=/opt/tsg/init_runtime/hosts
rollback_path=/opt/tsg/init_runtime/tasks/init_runtime.yml
rollback_exit_code=0
ansible-playbook -i ${hosts_path} ${rollback_path} -e "var_files_path=${backup_config_path}"
if [ $rollback_exit_code -ne 0 ];then
exit 1
fi

View File

@@ -1,32 +0,0 @@
maat_redis_server:
address: "192.168.100.1"
port: 7002
port_num: 1
db: 0
dynamic_maat_redis_server:
address: "192.168.100.1"
port: 7002
port_num: 1
db: 1
breakpad_upload_url: http://10.4.63.4:9000/api/2/minidump/?sentry_key=3203b43fd5384a7dbe6a48ecb1f3c595
data_center: Kyzylorda
tsg_master_entrance_id: 9
log_kafkabrokers:
address: ['1.1.1.1:9092','2.2.2.2:9092']
firewall:
hos_serverip: "192.168.40.223"
hos_serverport: 9098
APP_SKETCH_PUBLISH_TOPIC: "APP_SIGNATURE_ID"
APP_SKETCH_BROKER_LIST: "tcp://192.168.40.161:1883"
pangu_pxy:
log_cache:
address: "10.9.62.253"
port: 9090

View File

@@ -1,2 +0,0 @@
[local]
localhost ansible_connection=local

View File

@@ -1,7 +0,0 @@
---
- hosts: local
tasks:
- name: "backup_conf: backup the stage2 config files"
copy:
src: /data/init_runtime/runtime.yml
dest: /data/init_runtime/backup/

View File

@@ -1,125 +0,0 @@
---
- hosts: local
vars_files:
- '{{var_files_path}}'
tasks:
- name: "init_runtime: obtain result_exec_obtain_keepalive_subnet"
shell: ipmitool picmg addrinfo | grep "Hardware Address" | sed 's/^Hardware Address.*0x4\(.*\)/\1/' | awk '{print strtonum("0x"$1)+16'}
register: result_exec_obtain_keepalive_subnet
- name: "init_runtime: output results that executes command that gets the result_exec_obtain_keepalive_subnet"
debug:
msg: "{{ result_exec_obtain_keepalive_subnet }}"
- name: "init_runtime: check result_exec_obtain_keepalive_subnet"
assert:
that:
- result_exec_obtain_keepalive_subnet.rc == 0
- result_exec_obtain_keepalive_subnet.failed == False
- result_exec_obtain_keepalive_subnet.stdout_lines | length == 1
- result_exec_obtain_keepalive_subnet.stdout_lines[0] | int >= 16
- result_exec_obtain_keepalive_subnet.stdout_lines[0] | int <= 31
fail_msg: "error:{{ result_exec_obtain_keepalive_subnet.stderr }},stdout:{{ result_exec_obtain_keepalive_subnet.stdout_lines }}"
success_msg: "{{ result_exec_obtain_keepalive_subnet.stdout_lines[0] }}"
- name: "init_runtime: Set fact for field keepalive_subnet_ip"
set_fact:
keepalive_subnet_ip: "{{ result_exec_obtain_keepalive_subnet.stdout_lines[0] }}"
- name: "init_runtime: template gdev.conf file"
template:
src: "../templates/gdev.conf.j2"
dest: /home/mesasoft/sapp_run/etc/gdev.conf
tags: sapp
- name: "init_runtime: template mrglobal.conf file"
template:
src: "../templates/mrglobal.conf.j2"
dest: /opt/mrzcpd/etc/mrglobal.conf
tags: mrzcpd
- name: "init_runtime: template certstore configure file"
template:
src: "../templates/cert_store.ini.j2"
dest: /opt/tsg/certstore/conf/cert_store.ini
tags: certstore
- name: "init_runtime: Template the tsgconf/main.conf"
template:
src: "../templates/main.conf.j2"
dest: /home/mesasoft/sapp_run/tsgconf/main.conf
tags: firewall
- name: "init_runtime: Template the tsgconf/maat.conf"
template:
src: "../templates/maat.conf.j2"
dest: /home/mesasoft/sapp_run/tsgconf/maat.conf
tags: firewall
- name: "init_runtime: Template the conf/capture_packet_plug.conf"
template:
src: "../templates/capture_packet_plug.conf.j2"
dest: /home/mesasoft/sapp_run/conf/capture_packet_plug.conf
tags: firewall
- name: "init_runtime: Template the sapp.toml"
template:
src: "../templates/sapp.toml.j2"
dest: /home/mesasoft/sapp_run/etc/sapp.toml
tags: sapp
- name: "init_runtime: Templates telegraf.conf"
template:
src: "../templates/telegraf_statistic.conf.j2"
dest: /etc/telegraf/telegraf_statistic.conf
tags: telegraf_statistic
- name: "init_runtime: template the tfe.conf"
template:
src: "../templates/tfe.conf.j2"
dest: /opt/tsg/tfe/conf/tfe/tfe.conf
tags: tfe
- name: "init_runtime: template the pangu_pxy.conf"
template:
src: "../templates/pangu_pxy.conf.j2"
dest: /opt/tsg/tfe/conf/pangu/pangu_pxy.conf
tags: tfe
- name: "Stop mrzcpd"
systemd:
name: mrzcpd
state: restarted
tags: mrzcpd
- name: "Start mrzcpd"
systemd:
name: mrzcpd
state: restarted
tags: mrzcpd
- name: "Restart certstore"
systemd:
name: certstore
state: restarted
tags: certstore
- name: "Restart sapp"
systemd:
name: sapp
state: restarted
tags:
- sapp
- firewall
- name: "Restart telegraf_statistic"
systemd:
name: telegraf_statistic
state: restarted
tags: telegraf_statistic
- name: "Restart tfe"
systemd:
name: tfe
state: restarted
tags: tfe

View File

@@ -1,13 +0,0 @@
- name: "init_runtime: copy init_runtime scripts to docker"
copy:
src: "{{ role_path }}/files/init_runtime"
dest: /opt/tsg/
mode: 0644
- name: "init_runtime: chmod 0755 for exec_init_runtime.sh and exec_rollback.sh"
file:
path: "{{ item }}"
mode: '0755'
with_items:
- /opt/tsg/init_runtime/exec_init_runtime.sh
- /opt/tsg/init_runtime/exec_rollback.sh