This commit is contained in:
devdatt 2025-12-23 12:12:36 +05:30
parent c94d2cfffa
commit 84cf29cefb
1 changed files with 6 additions and 2 deletions

View File

@ -138,10 +138,15 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
'version' => 2, 'version' => 2,
'renderer' => 'networkd', 'renderer' => 'networkd',
'ethernets' => [], 'ethernets' => [],
'vlans' => []
] ]
]; ];
if (!empty($netplan['network']['vlans'])) {
$netplan['network']['vlans'] = $netplan['network']['vlans'];
} else {
$netplan['network']['vlans'] = new stdClass(); // forces {}
}
foreach (['primary', 'secondary'] as $type) { foreach (['primary', 'secondary'] as $type) {
if ( if (
@ -168,7 +173,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
} }
file_put_contents('/var/www/50-cloud-init.yaml', netplan_yaml($netplan)); file_put_contents('/var/www/50-cloud-init.yaml', netplan_yaml($netplan));
} }
} }