$ cat my-manual.yaml
version: 1
config:
- type: physical
name: eth0
mac_address: "52:54:00:12:34:00"
subnets:
- type: static
address: 192.168.1.2/24
- type: manual
address: 192.168.1.3/24
$ rm -Rf out.d; PYTHONPATH=$PWD ./tools/net-convert.py --network-data=my-manual.yaml --kind=yaml --mac=eth0,aa:bb:cc:dd:e8:00 --directory=out.d --output-kind=sysconfig
Input YAML
config:
- mac_address: '52:54:00:12:34:00'
name: eth0
subnets:
- address: 192.168.1.2/24
type: static
- address: 192.168.1.3/24
type: manual
type: physical
version: 1
Internal State
!!python/object:cloudinit.net.network_state.NetworkState
_network_state:
dns:
nameservers: []
search: []
interfaces:
eth0:
address: null
gateway: null
inet: inet
mac_address: '52:54:00:12:34:00'
mode: manual
mtu: null
name: eth0
subnets:
- address: 192.168.1.2
netmask: 255.255.255.0
prefix: 24
routes: []
type: static
- address: 192.168.1.3/24
routes: []
type: manual
type: physical
routes: []
use_ipv6: false
_version: 1
use_ipv6: false
$ cat out.d/etc/sysconfig/network-scripts/ifcfg-eth0
# Created by cloud-init on instance boot automatically, do not edit.
#
BOOTPROTO=none
DEVICE=eth0
HWADDR=52:54:00:12:34:00
IPADDR=192.168.1.2
NETMASK=255.255.255.0
NM_CONTROLLED=no
ONBOOT=no
TYPE=Ethernet
USERCTL=no