forked from TencentBlueKing/bk-install
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathupdate.rc
More file actions
88 lines (71 loc) · 1.88 KB
/
Copy pathupdate.rc
File metadata and controls
88 lines (71 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# vim:ft=sh sts=4 ts=4
source $CTRL_DIR/utils.fc
source $CTRL_DIR/bin/02-dynamic/hosts.env
update () {
local m=$1
check_name update $m
update_$m
}
update_consul () {
local ip
cd $CTRL_DIR
step "update consul configurations"
for ip in ${ALL_IP[@]}; do
rcmd root@$ip "export ENCRYPT_KEY=$(_app_token consul);
rm -f $INSTALL_PATH/etc/consul.d/*.json;
./pxs -c install.config -o -e -s -p $INSTALL_PATH -a $ip;
source ./control.rc; reload_consul"
done
}
update_rcfile () {
local ip
cd $CTRL_DIR
step "update \$HOME/.bkrc file"
for ip in ${ALL_IP[@]}; do
rcmd root@$ip "gen_bkrc"
done
}
update_hosts () {
local ip
step "update /etc/hosts"
for ip in ${ALL_IP[@]}; do
rcmd root@$ip "add_hosts"
done
}
update_hosts_bcs () {
step "update /etc/hosts for bcs"
for ip in ${ALL_IP[@]}; do
rcmd root@$ip "source $CTRL_DIR/utils.fc; add_hosts_bcs"
done
}
update_hosts_paas () {
local ip
step "update /etc/hosts for bkce"
for ip in ${ALL_IP[@]}; do
rcmd root@$ip "add_hosts_paas"
done
}
update_hosts_ci () {
local ip
step "update /etc/hosts for ci"
for ip in ${ALL_IP[@]}; do
rcmd root@$ip "add_hosts_ci"
done
}
update_hostname () {
local ip
step "set hostname for all hosts"
for ip in ${ALL_IP[@]}; do
rcmd root@$ip "set_hostname"
done
}
update_appo_script () {
for ip in ${APPO_IP[@]} ${APPT_IP[@]}; do
_rsync appmgr/ root@$ip:$INSTALL_PATH/paas_agent/paas_agent/etc/build/
done
}
update_bkenv () {
step "update bkenv for all hosts"
pssh -i -h <(printf "%s\n" "${ALL_IP[@]}") "source ${CTRL_DIR}/functions;source ${CTRL_DIR}/.rcmdrc;source ${CTRL_DIR}/load_env.sh;gen_bkrc"
pssh -i -h <(printf "%s\n" "${ALL_IP[@]}") "set -a; source ${CTRL_DIR}/load_env.sh; $CTRL_DIR/bin/update_bk_env.sh"
}