core: 规范化云镜像静态 ipv6 配置

This commit is contained in:
bin456789 2023-11-12 22:14:56 +08:00
parent a86d1bb078
commit 0abbeb7085
No known key found for this signature in database
GPG Key ID: EE301B386DE6C11B

View File

@ -876,9 +876,15 @@ create_cloud_init_network_config() {
get_netconf_to ipv6_gateway
# centos7 不认识 static6但可改成 static作用相同
# 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 "
.network.config[0].subnets += [{
\"type\": \"static\",
\"type\": \"$type_ipv6_static\",
\"address\": \"$ipv6_addr\",
\"gateway\": \"$ipv6_gateway\" }]
" $ci_file