diff --git a/cloudinit/config/cc_grub_dpkg.py b/cloudinit/config/cc_grub_dpkg.py index 6ab7ac48e6a..7107f1fe3c2 100644 --- a/cloudinit/config/cc_grub_dpkg.py +++ b/cloudinit/config/cc_grub_dpkg.py @@ -24,7 +24,7 @@ "id": "cc_grub_dpkg", "distros": ["ubuntu", "debian"], "frequency": PER_INSTANCE, - "activate_by_schema_keys": [], + "activate_by_schema_keys": ["grub_dpkg", "grub-dpkg"], } LOG = logging.getLogger(__name__) @@ -115,7 +115,7 @@ def handle(name: str, cfg: Config, cloud: Cloud, args: list) -> None: if not mycfg: mycfg = {} - enabled = mycfg.get("enabled", True) + enabled = mycfg.get("enabled", False) if util.is_false(enabled): LOG.debug("%s disabled by config grub_dpkg/enabled=%s", name, enabled) return diff --git a/cloudinit/config/schemas/schema-cloud-config-v1.json b/cloudinit/config/schemas/schema-cloud-config-v1.json index 3d1c1a89697..fffa04b5266 100644 --- a/cloudinit/config/schemas/schema-cloud-config-v1.json +++ b/cloudinit/config/schemas/schema-cloud-config-v1.json @@ -1611,8 +1611,8 @@ "properties": { "enabled": { "type": "boolean", - "default": true, - "description": "Whether to configure which device is used as the target for grub installation. Default: ``true``." + "default": false, + "description": "Whether to configure which device is used as the target for grub installation. Default: ``false``." }, "grub-pc/install_devices": { "type": "string", diff --git a/tests/unittests/config/test_cc_grub_dpkg.py b/tests/unittests/config/test_cc_grub_dpkg.py index dfefca47429..1859cab3c0c 100644 --- a/tests/unittests/config/test_cc_grub_dpkg.py +++ b/tests/unittests/config/test_cc_grub_dpkg.py @@ -248,7 +248,7 @@ def test_handle( """Test setting of correct debconf database entries""" m_is_efi_booted.return_value = is_uefi m_fetch_idevs.return_value = fetch_idevs_output - cfg = {"grub_dpkg": {}} + cfg = {"grub_dpkg": {"enabled": True}} if cfg_idevs is not None: cfg["grub_dpkg"]["grub-pc/install_devices"] = cfg_idevs if cfg_idevs_empty is not None: