1.add role tsg_env_patch

2.delete role which is unuseful
This commit is contained in:
fumingwei
2020-11-17 17:45:40 +06:00
parent cc7155ec1a
commit 3b125413ce
21 changed files with 72 additions and 113 deletions

View File

@@ -30,6 +30,10 @@
#[adc_mcn3] #[adc_mcn3]
#10.3.76.1 device_id=device_1 #10.3.76.1 device_id=device_1
#10.3.76.2 device_id=device_2 #10.3.76.2 device_id=device_2
#info warning
#broken blade list
#10.14.53.20
#10.14.54.2
[adc_mxn] [adc_mxn]
10.14.55.[1:20] 10.14.55.[1:20]

View File

@@ -1,5 +0,0 @@
- hosts: adc_mcn0
remote_user: root
roles:
- docker-env
- tsg-diagnose

View File

@@ -1,4 +0,0 @@
- hosts: adc_mxn
remote_user: root
roles:
- reboot-all-adc

View File

@@ -1,4 +0,0 @@
- hosts: adc_mxn
remote_user: root
roles:
- reboot-adc-mcn-by-ipmitool

View File

@@ -1,13 +0,0 @@
- hosts: adc_mcn0
remote_user: root
roles:
- sapp_restart
- certstore_restart
- hosts:
- adc_mcn1
- adc_mcn2
- adc_mcn3
remote_user: root
roles:
- tfe_restart

View File

@@ -1,20 +0,0 @@
- name: "maat-redis-uninstall: stop maat-redis service"
systemd:
name: "{{ item }}"
state: stopped
with_items:
- maat-redis.service
- redis.service
- name: "maat-redis-uninstall: rm maat-redis.conf and maat-redis.service"
file:
path: "{{ item }}"
state: absent
with_items:
- /etc/maat-redis.conf
- /usr/lib/systemd/system/maat-redis.service
- name: remove redis
yum:
name: redis
state: absent

View File

@@ -1,8 +0,0 @@
- name: "reboot adc in mxn by ipmitool"
shell: "{{ item }}"
ignore_errors: true
with_items:
- ipmitool -t 0x90 chassis power reset
- ipmitool -t 0x80 chassis power reset
- ipmitool -t 0x88 chassis power reset
- ipmitool -t 0x98 chassis power reset

View File

@@ -1,9 +0,0 @@
- name: "reboot adc"
shell: "{{ item }}"
ignore_errors: true
with_items:
- ssh 192.168.100.1 reboot
- ssh 192.168.100.2 reboot
- ssh 192.168.100.3 reboot
- ssh 192.168.100.4 reboot
- reboot

View File

@@ -1,7 +0,0 @@
- name: 'sapp service start'
systemd:
name: sapp
enabled: yes
daemon_reload: yes
state: restarted

View File

@@ -1,7 +0,0 @@
- name: 'tfe service start'
systemd:
name: tfe
enabled: yes
daemon_reload: yes
state: restarted

View File

@@ -1,7 +0,0 @@
#!/bin/bash
systemctl stop docker &&
systemctl disable docker &&
#执行不成功就把下面的注释
#yum remove docker-ce &&
rm -rf /var/lib/docker &&
rm -rf $(whereis docker)

View File

@@ -1,22 +0,0 @@
- name: stop tsg-diagnose
systemd:
name: tsg-diagnose
state: stopped
- name: docker-compose down
shell: cd /opt/tsg/tsg-diagnose/compose; docker-compose down; docker-compose down
- name: remove the tsg-diagnose
yum:
name: tsg-diagnose
state: absent
- name: copy origin uninstall docker shell file
copy:
src: "{{ role_path }}/files/"
dest: /tmp/ansible_deploy/
mode: 0755
- name: rm docker-compose
shell: cd /tmp/ansible_deploy/; sh xz_docker.sh;rm /usr/local/bin/docker-compose

View File

@@ -0,0 +1,8 @@
99c99
< ${CURRENT_PATH}/${REMOTE_CONTROL_BIN} -s ${TP_SVR} -n ${TP_PORT} -c "show version"
---
> echo "show version" | nc ${TP_SVR} ${TP_PORT}
136c136
< MAC_TABLE=`${CURRENT_PATH}/${REMOTE_CONTROL_BIN} -s ${TP_SVR} -n ${TP_PORT} -c "show mac table all"`
---
> MAC_TABLE=$(echo "show mac table all" | nc ${TP_SVR} ${TP_PORT})

View File

@@ -0,0 +1,5 @@
- name: "patch setup scripts in tsg-env"
patch:
src: "{{ role_path }}/files/replace_switch_non_block_with_nc_v2.patch"
dest: /opt/tsg/env/setup
backup: true

View File

@@ -0,0 +1,11 @@
- hosts: adc_mxn
remote_user: root
tasks:
- name: "reboot adc in mxn by ipmitool"
shell: "{{ item }}"
ignore_errors: true
with_items:
- ipmitool -t 0x90 chassis power reset
- ipmitool -t 0x80 chassis power reset
- ipmitool -t 0x98 chassis power reset
- ipmitool -t 0x88 chassis power reset

View File

@@ -0,0 +1,12 @@
- hosts: adc_mxn
remote_user: root
tasks:
- name: "reboot adc mcn*"
shell: "{{ item }}"
ignore_errors: true
with_items:
- ssh 192.168.100.1 reboot
- ssh 192.168.100.2 reboot
- ssh 192.168.100.3 reboot
- ssh 192.168.100.4 reboot

View File

@@ -0,0 +1,24 @@
- hosts: host_uninstall_redis
remote_user: root
tasks:
- name: "maat-redis-uninstall: stop maat-redis service"
systemd:
name: "{{ item }}"
state: stopped
with_items:
- maat-redis.service
- redis.service
- name: "maat-redis-uninstall: rm maat-redis.conf and maat-redis.service"
file:
path: "{{ item }}"
state: absent
with_items:
- /etc/maat-redis.conf
- /usr/lib/systemd/system/maat-redis.service
- name: remove redis
yum:
name: redis
state: absent

8
tsg_env_patch.yml Normal file
View File

@@ -0,0 +1,8 @@
- hosts:
- adc_mcn0
- adc_mcn1
- adc_mcn2
- adc_mcn3
remote_user: root
roles:
- tsg-env-patch

View File

@@ -1,3 +0,0 @@
- hosts: host_uninstall_redis
roles:
- maat-redis-uninstall

View File

@@ -1,4 +0,0 @@
- hosts: adc_mcn0
remote_user: root
roles:
- tsg-diagnose-uninstall