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": [
{
"name": "pxe0",
"id": "pxe0",
"type": "phy",
"ethernet_mac_address": "52:54:00:7d:15:63"
},
{
"name": "oam0",
"type": "phy",
"id": "oam0",
"ethernet_mac_address": "52:54:00:bf:b2:d8"
},
{
"name": "stor0",
"id": "stor0",
"type": "phy",
"ethernet_mac_address": "52:54:00:9b:2c:71"
},
{
"name": "underlay0",
"type": "phy",
"id": "underlay0",
"ethernet_mac_address": "52:54:00:9b:2c:71"
}
],
"networks": [
{
"id": "pxe0-ipv4",
"type": "ipv4",
"link": "pxe0",
"ip_address": "192.168.10.100",
"netmask": "255.255.255.0"
},
{
"id": "oam0-ipv4",
"type": "ipv4",
"link": "oam0",
"ip_address": "192.168.100.100",
"netmask": "255.255.255.0",
"routes": [
{
"network": "0.0.0.0",
"netmask": "0.0.0.0",
"gateway": "192.168.100.1"
}
]
},
{
"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"
}
]
}
---
links:
- name: pxe0
id: pxe0
type: phy
ethernet_mac_address: 52:54:00:7d:15:63
- name: oam0
type: phy
id: oam0
ethernet_mac_address: 52:54:00:bf:b2:d8
- name: stor0
id: stor0
type: phy
ethernet_mac_address: 52:54:00:9b:2c:71
- name: underlay0
type: phy
id: underlay0
ethernet_mac_address: 52:54:00:9b:2c:71
networks:
- id: pxe0-ipv4
type: ipv4
link: pxe0
ip_address: 192.168.10.100
netmask: 255.255.255.0
- id: oam0-ipv4
type: ipv4
link: oam0
ip_address: 192.168.100.100
netmask: 255.255.255.0
routes:
- network: 0.0.0.0
netmask: 0.0.0.0
gateway: 192.168.100.1
- 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}"
cp "${BASEDIR}/meta_data.json" "${CLOUD_DATA_LATEST}"
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 ]" > \
"${CHROOT}/etc/cloud/cloud.cfg.d/95_no_cloud_ds.cfg"