Replace input network-data format to yaml

Airshipctl deliver network-data from ephimeral BMH to isogen in yaml format.

Relates-To: #120

Change-Id: Id83f1ec7a71d1db5f34f4bcc826a7c5a7911ede2
This commit is contained in:
Nikolay Fedorov 2020-03-19 16:17:55 +04:00
parent 28c08bfd38
commit c604dbf7bf
2 changed files with 47 additions and 74 deletions

View File

@ -1,74 +1,47 @@
{ ---
"links": [ links:
{ - name: pxe0
"name": "pxe0", id: pxe0
"id": "pxe0", type: phy
"type": "phy", ethernet_mac_address: 52:54:00:7d:15:63
"ethernet_mac_address": "52:54:00:7d:15:63" - name: oam0
}, type: phy
{ id: oam0
"name": "oam0", ethernet_mac_address: 52:54:00:bf:b2:d8
"type": "phy", - name: stor0
"id": "oam0", id: stor0
"ethernet_mac_address": "52:54:00:bf:b2:d8" type: phy
}, ethernet_mac_address: 52:54:00:9b:2c:71
{ - name: underlay0
"name": "stor0", type: phy
"id": "stor0", id: underlay0
"type": "phy", ethernet_mac_address: 52:54:00:9b:2c:71
"ethernet_mac_address": "52:54:00:9b:2c:71" networks:
}, - id: pxe0-ipv4
{ type: ipv4
"name": "underlay0", link: pxe0
"type": "phy", ip_address: 192.168.10.100
"id": "underlay0", netmask: 255.255.255.0
"ethernet_mac_address": "52:54:00:9b:2c:71" - id: oam0-ipv4
} type: ipv4
], link: oam0
"networks": [ ip_address: 192.168.100.100
{ netmask: 255.255.255.0
"id": "pxe0-ipv4", routes:
"type": "ipv4", - network: 0.0.0.0
"link": "pxe0", netmask: 0.0.0.0
"ip_address": "192.168.10.100", gateway: 192.168.100.1
"netmask": "255.255.255.0" - id: stor0-ipv4
}, type: ipv4
{ link: stor0
"id": "oam0-ipv4", ip_address: 192.168.20.100
"type": "ipv4", netmask: 255.255.255.0
"link": "oam0", - id: underlay0-ipv4
"ip_address": "192.168.100.100", type: ipv4
"netmask": "255.255.255.0", link: underlay0
"routes": [ ip_address: 192.168.30.100
{ netmask: 255.255.255.0
"network": "0.0.0.0", services:
"netmask": "0.0.0.0", - address: 8.8.8.8
"gateway": "192.168.100.1" type: dns
}
]
},
{
"id": "stor0-ipv4",
"type": "ipv4",
"link": "stor0",
"ip_address": "192.168.20.100",
"netmask": "255.255.255.0"
},
{
"id": "underlay0-ipv4",
"type": "ipv4",
"link": "underlay0",
"ip_address": "192.168.30.100",
"netmask": "255.255.255.0"
}
],
"services": [
{
"address": "8.8.8.8",
"type": "dns"
}
]
}

View File

@ -28,7 +28,7 @@ chroot "${CHROOT}" < "${BASEDIR}/packages_install.sh"
mkdir -p "${CLOUD_DATA_LATEST}" mkdir -p "${CLOUD_DATA_LATEST}"
cp "${BASEDIR}/meta_data.json" "${CLOUD_DATA_LATEST}" cp "${BASEDIR}/meta_data.json" "${CLOUD_DATA_LATEST}"
cp "${USER_DATA}" "${CLOUD_DATA_LATEST}/user_data" cp "${USER_DATA}" "${CLOUD_DATA_LATEST}/user_data"
cp "${NET_CONFIG}" "${CLOUD_DATA_LATEST}/network_data.json" yq r -j "${NET_CONFIG}" > "${CLOUD_DATA_LATEST}/network_data.json"
echo "datasource_list: [ ConfigDrive, None ]" > \ echo "datasource_list: [ ConfigDrive, None ]" > \
"${CHROOT}/etc/cloud/cloud.cfg.d/95_no_cloud_ds.cfg" "${CHROOT}/etc/cloud/cloud.cfg.d/95_no_cloud_ds.cfg"