core: 云镜像禁用 NoCloud 数据源

能防止 cloud-init 使用 sr0 的配置文件
This commit is contained in:
bin456789 2023-11-12 17:29:15 +08:00
parent a9cd00f7da
commit 58ff5f69f2
No known key found for this signature in database
GPG Key ID: EE301B386DE6C11B
2 changed files with 2 additions and 2 deletions

View File

@ -1,5 +1,5 @@
#cloud-config
datasource_list: [NoCloud]
datasource_list: [None]
timezone: Asia/Shanghai
disable_root: false
ssh_pwauth: true

View File

@ -895,7 +895,7 @@ create_cloud_init_network_config() {
download_cloud_init_config() {
os_dir=$1
ci_file=$os_dir/etc/cloud/cloud.cfg.d/99_nocloud.cfg
ci_file=$os_dir/etc/cloud/cloud.cfg.d/99_fallback.cfg
download $confhome/cloud-init.yaml $ci_file
# 删除注释行,除了第一行
sed -i '1!{/^[[:space:]]*#/d}' $ci_file