如何禁用Cloud Init网络?

7

我正在尝试禁用云初始化网络配置。根据云初始化文档,我需要在内核命令行条目中设置network-config={config: disabled}

当我将其设置在/etc/default/grub中时:

GRUB_CMDLINE_LINUX="network-config={config: disabled}"

我想运行update-grub,但是它给了我以下错误:

generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.4.0-116-generic
Found initrd image: /boot/initrd.img-4.4.0-116-generic
Found linux image: /boot/vmlinuz-4.4.0-104-generic
Found initrd image: /boot/initrd.img-4.4.0-104-generic
Found linux image: /boot/vmlinuz-4.4.0-97-generic
Found initrd image: /boot/initrd.img-4.4.0-97-generic
error: syntax error.
error: Incorrect command.
error: syntax error.
error: Incorrect command.
error: syntax error.
Syntax error at line 128
Syntax errors are detected in generated GRUB config file.
Ensure that there are no errors in /etc/default/grub
and /etc/grub.d/* files or please file a bug report with
/boot/grub/grub.cfg.new file attached.
done

看起来它不能接受一个yaml字符串。

我是在正确的位置进行配置吗?

谢谢

1个回答

15

/etc/cloud/cloud.cfg.d/99-custom-networking.cfg中创建一个文件,其中包含:

network: {config: disabled}

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接