提交各组件部署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,18 @@
#!/bin/bash
function del_ipaddr(){
keepHostCheck=`ip address show {{ vrrp_instance.default.interface }} | grep "{{ vrrp_instance.default.virtual_ipaddress }}" | wc -l`
if [ $keepHostCheck -eq "1" ];then
ip address del {{ vrrp_instance.default.virtual_ipaddress }} dev {{ vrrp_instance.default.interface }}
fi
}
if [ -f "/etc/keepalived/conf.d/keepalived-mariadb.conf" ];then
rm -rf /etc/keepalived/check_mariadb.sh
rm -rf /etc/keepalived/conf.d/keepalived-mariadb.conf
service keepalived stop && systemctl daemon-reload && sleep 3 && service keepalived start
del_ipaddr
else
del_ipaddr
fi