mirror of
https://github.com/bin456789/reinstall.git
synced 2025-01-31 19:08:07 +08:00
core: 规范化云镜像静态 ipv6 配置
This commit is contained in:
parent
a86d1bb078
commit
0abbeb7085
8
trans.sh
8
trans.sh
@ -876,9 +876,15 @@ create_cloud_init_network_config() {
|
|||||||
get_netconf_to ipv6_gateway
|
get_netconf_to ipv6_gateway
|
||||||
# centos7 不认识 static6,但可改成 static,作用相同
|
# centos7 不认识 static6,但可改成 static,作用相同
|
||||||
# https://github.com/canonical/cloud-init/commit/dacdd30080bd8183d1f1c1dc9dbcbc8448301529
|
# https://github.com/canonical/cloud-init/commit/dacdd30080bd8183d1f1c1dc9dbcbc8448301529
|
||||||
|
if [ -f /os/etc/system-release-cpe ] &&
|
||||||
|
grep centos:7 /os/etc/system-release-cpe; then
|
||||||
|
type_ipv6_static=static
|
||||||
|
else
|
||||||
|
type_ipv6_static=static6
|
||||||
|
fi
|
||||||
yq -i "
|
yq -i "
|
||||||
.network.config[0].subnets += [{
|
.network.config[0].subnets += [{
|
||||||
\"type\": \"static\",
|
\"type\": \"$type_ipv6_static\",
|
||||||
\"address\": \"$ipv6_addr\",
|
\"address\": \"$ipv6_addr\",
|
||||||
\"gateway\": \"$ipv6_gateway\" }]
|
\"gateway\": \"$ipv6_gateway\" }]
|
||||||
" $ci_file
|
" $ci_file
|
||||||
|
Loading…
x
Reference in New Issue
Block a user