diff --git a/Taldykurgan_install_config/hosts b/Taldykurgan_install_config/hosts index 367b383..2f1a54c 100644 --- a/Taldykurgan_install_config/hosts +++ b/Taldykurgan_install_config/hosts @@ -30,6 +30,10 @@ #[adc_mcn3] #10.3.76.1 device_id=device_1 #10.3.76.2 device_id=device_2 +#info warning +#broken blade list +#10.14.53.20 +#10.14.54.2 [adc_mxn] 10.14.55.[1:20] diff --git a/install_process.yml b/install_process.yml deleted file mode 100644 index 5cf050d..0000000 --- a/install_process.yml +++ /dev/null @@ -1,5 +0,0 @@ -- hosts: adc_mcn0 - remote_user: root - roles: - - docker-env - - tsg-diagnose diff --git a/reboot_adc.yml b/reboot_adc.yml deleted file mode 100644 index ccf172d..0000000 --- a/reboot_adc.yml +++ /dev/null @@ -1,4 +0,0 @@ -- hosts: adc_mxn - remote_user: root - roles: - - reboot-all-adc diff --git a/reboot_adc_mcn_by_ipmitool.yml b/reboot_adc_mcn_by_ipmitool.yml deleted file mode 100644 index 58dc572..0000000 --- a/reboot_adc_mcn_by_ipmitool.yml +++ /dev/null @@ -1,4 +0,0 @@ -- hosts: adc_mxn - remote_user: root - roles: - - reboot-adc-mcn-by-ipmitool diff --git a/restart_sapp_and_tfe.yml b/restart_sapp_and_tfe.yml deleted file mode 100644 index a18fb20..0000000 --- a/restart_sapp_and_tfe.yml +++ /dev/null @@ -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 diff --git a/roles/maat-redis-uninstall/tasks/main.yml b/roles/maat-redis-uninstall/tasks/main.yml deleted file mode 100644 index 083a2db..0000000 --- a/roles/maat-redis-uninstall/tasks/main.yml +++ /dev/null @@ -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 diff --git a/roles/reboot-adc-mcn-by-ipmitool/tasks/main.yml b/roles/reboot-adc-mcn-by-ipmitool/tasks/main.yml deleted file mode 100644 index 95b7a08..0000000 --- a/roles/reboot-adc-mcn-by-ipmitool/tasks/main.yml +++ /dev/null @@ -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 diff --git a/roles/reboot-all-adc/tasks/main.yml b/roles/reboot-all-adc/tasks/main.yml deleted file mode 100644 index ce091a1..0000000 --- a/roles/reboot-all-adc/tasks/main.yml +++ /dev/null @@ -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 diff --git a/roles/sapp_restart/tasks/main.yml b/roles/sapp_restart/tasks/main.yml deleted file mode 100644 index a649cde..0000000 --- a/roles/sapp_restart/tasks/main.yml +++ /dev/null @@ -1,7 +0,0 @@ -- name: 'sapp service start' - systemd: - name: sapp - enabled: yes - daemon_reload: yes - state: restarted - diff --git a/roles/tfe_restart/tasks/main.yml b/roles/tfe_restart/tasks/main.yml deleted file mode 100644 index 806216e..0000000 --- a/roles/tfe_restart/tasks/main.yml +++ /dev/null @@ -1,7 +0,0 @@ -- name: 'tfe service start' - systemd: - name: tfe - enabled: yes - daemon_reload: yes - state: restarted - diff --git a/roles/tsg-diagnose-uninstall/files/xz_docker.sh b/roles/tsg-diagnose-uninstall/files/xz_docker.sh deleted file mode 100644 index a31f962..0000000 --- a/roles/tsg-diagnose-uninstall/files/xz_docker.sh +++ /dev/null @@ -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) \ No newline at end of file diff --git a/roles/tsg-diagnose-uninstall/tasks/main.yml b/roles/tsg-diagnose-uninstall/tasks/main.yml deleted file mode 100644 index 3b34206..0000000 --- a/roles/tsg-diagnose-uninstall/tasks/main.yml +++ /dev/null @@ -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 - diff --git a/roles/tsg-env-patch/files/replace_switch_non_block_with_nc_v2.patch b/roles/tsg-env-patch/files/replace_switch_non_block_with_nc_v2.patch new file mode 100644 index 0000000..a149c6d --- /dev/null +++ b/roles/tsg-env-patch/files/replace_switch_non_block_with_nc_v2.patch @@ -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}) diff --git a/roles/tsg-env-patch/tasks/main.yml b/roles/tsg-env-patch/tasks/main.yml new file mode 100644 index 0000000..cc4f163 --- /dev/null +++ b/roles/tsg-env-patch/tasks/main.yml @@ -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 diff --git a/roles/maat-redis-uninstall/templates/maat-redis.conf.j2 b/roles/tsg-env-patch/templates/maat-redis.conf.j2 similarity index 100% rename from roles/maat-redis-uninstall/templates/maat-redis.conf.j2 rename to roles/tsg-env-patch/templates/maat-redis.conf.j2 diff --git a/tasks/reboot_adc_mcn_by_ipmitool.yml b/tasks/reboot_adc_mcn_by_ipmitool.yml new file mode 100644 index 0000000..040a85e --- /dev/null +++ b/tasks/reboot_adc_mcn_by_ipmitool.yml @@ -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 diff --git a/tasks/reboot_adc_mcn_by_ssh.yml b/tasks/reboot_adc_mcn_by_ssh.yml new file mode 100644 index 0000000..df3fc23 --- /dev/null +++ b/tasks/reboot_adc_mcn_by_ssh.yml @@ -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 + diff --git a/tasks/uninstall_maat_redis.yml b/tasks/uninstall_maat_redis.yml new file mode 100644 index 0000000..378f031 --- /dev/null +++ b/tasks/uninstall_maat_redis.yml @@ -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 + diff --git a/tsg_env_patch.yml b/tsg_env_patch.yml new file mode 100644 index 0000000..ceee724 --- /dev/null +++ b/tsg_env_patch.yml @@ -0,0 +1,8 @@ +- hosts: + - adc_mcn0 + - adc_mcn1 + - adc_mcn2 + - adc_mcn3 + remote_user: root + roles: + - tsg-env-patch diff --git a/uninstall_maat_redis.yml b/uninstall_maat_redis.yml deleted file mode 100644 index 1ebb3be..0000000 --- a/uninstall_maat_redis.yml +++ /dev/null @@ -1,3 +0,0 @@ -- hosts: host_uninstall_redis - roles: - - maat-redis-uninstall diff --git a/uninstall_process.yml b/uninstall_process.yml deleted file mode 100644 index cad5be9..0000000 --- a/uninstall_process.yml +++ /dev/null @@ -1,4 +0,0 @@ -- hosts: adc_mcn0 - remote_user: root - roles: - - tsg-diagnose-uninstall