Unify network devices and addresses in config
The old way of doing this was a little cumbersome, with an upper YAML tree split between "devices" (name and MTU) and addresses. This commit unifies these under the root "networking" section to make this section clearer.
This commit is contained in:
parent
e70255dbd6
commit
1d3f868206
|
@ -124,31 +124,27 @@ pvc:
|
||||||
# networking: PVC networking configuration
|
# networking: PVC networking configuration
|
||||||
# OPTIONAL if enable_networking: False
|
# OPTIONAL if enable_networking: False
|
||||||
networking:
|
networking:
|
||||||
# devices: Interface devices configuration
|
|
||||||
devices:
|
|
||||||
# upstream: Upstream physical interface device
|
# upstream: Upstream physical interface device
|
||||||
upstream:
|
upstream:
|
||||||
# name: Upstream interface name
|
# name: Upstream interface name
|
||||||
name: ens4
|
name: ens4
|
||||||
# mtu: Upstream interface MTU; use 9000 for jumbo frames (requires switch support)
|
# mtu: Upstream interface MTU; use 9000 for jumbo frames (requires switch support)
|
||||||
mtu: 1500
|
mtu: 1500
|
||||||
|
# address: Network address for upstream network, options: None, by-id, <static>/<mask>
|
||||||
|
address: None
|
||||||
# cluster: Cluster (VNIC) physical interface device
|
# cluster: Cluster (VNIC) physical interface device
|
||||||
cluster:
|
cluster:
|
||||||
# name: Cluster (VNIC) interface name
|
# name: Cluster (VNIC) interface name
|
||||||
name: ens4
|
name: ens4
|
||||||
# mtu: Cluster (VNIC) interface MTU; use 9000 for jumbo frames (requires switch support)
|
# mtu: Cluster (VNIC) interface MTU; use 9000 for jumbo frames (requires switch support)
|
||||||
mtu: 1500
|
mtu: 1500
|
||||||
|
# address: Network address for cluster network, options: by-id, <static>/<mask>
|
||||||
|
address: by-id
|
||||||
# storage: Storage (Ceph OSD) physical interface device
|
# storage: Storage (Ceph OSD) physical interface device
|
||||||
storage:
|
storage:
|
||||||
# name: Storace (Ceph OSD) interface name
|
# name: Storace (Ceph OSD) interface name
|
||||||
name: ens4
|
name: ens4
|
||||||
# mtu: Storage (Ceph OSD) interface MTU; use 9000 for jumbo frames (requires switch support)
|
# mtu: Storage (Ceph OSD) interface MTU; use 9000 for jumbo frames (requires switch support)
|
||||||
mtu: 1500
|
mtu: 1500
|
||||||
# addresses: Special network addresses; by-id denotes "address octet equals host number", e.g. .3 for host3
|
# address: Network address for storage network, options: by-id, <static>/<mask>
|
||||||
addresses:
|
address: by-id
|
||||||
# upstream: Network address for upstream network, options: None, by-id, <static>/<mask>
|
|
||||||
upstream: None
|
|
||||||
# cluster: Network address for cluster network, options: by-id, <static>/<mask>
|
|
||||||
cluster: by-id
|
|
||||||
# storage: Network address for storage network, options: by-id, <static>/<mask>
|
|
||||||
storage: by-id
|
|
||||||
|
|
|
@ -179,15 +179,15 @@ def readConfig(pvcd_config_file, myhostname):
|
||||||
'pdns_postgresql_dbname': o_config['pvc']['coordinator']['dns']['database']['name'],
|
'pdns_postgresql_dbname': o_config['pvc']['coordinator']['dns']['database']['name'],
|
||||||
'pdns_postgresql_user': o_config['pvc']['coordinator']['dns']['database']['user'],
|
'pdns_postgresql_user': o_config['pvc']['coordinator']['dns']['database']['user'],
|
||||||
'pdns_postgresql_password': o_config['pvc']['coordinator']['dns']['database']['pass'],
|
'pdns_postgresql_password': o_config['pvc']['coordinator']['dns']['database']['pass'],
|
||||||
'vni_dev': o_config['pvc']['system']['configuration']['networking']['devices']['cluster']['name'],
|
'vni_dev': o_config['pvc']['system']['configuration']['networking']['cluster']['name'],
|
||||||
'vni_mtu': o_config['pvc']['system']['configuration']['networking']['devices']['cluster']['mtu'],
|
'vni_mtu': o_config['pvc']['system']['configuration']['networking']['cluster']['mtu'],
|
||||||
'vni_dev_ip': o_config['pvc']['system']['configuration']['networking']['addresses']['cluster'],
|
'vni_dev_ip': o_config['pvc']['system']['configuration']['networking']['cluster']['address'],
|
||||||
'storage_dev': o_config['pvc']['system']['configuration']['networking']['devices']['storage']['name'],
|
'storage_dev': o_config['pvc']['system']['configuration']['networking']['storage']['name'],
|
||||||
'storage_mtu': o_config['pvc']['system']['configuration']['networking']['devices']['storage']['mtu'],
|
'storage_mtu': o_config['pvc']['system']['configuration']['networking']['storage']['mtu'],
|
||||||
'storage_dev_ip': o_config['pvc']['system']['configuration']['networking']['addresses']['storage'],
|
'storage_dev_ip': o_config['pvc']['system']['configuration']['networking']['storage']['address'],
|
||||||
'upstream_dev': o_config['pvc']['system']['configuration']['networking']['devices']['upstream']['name'],
|
'upstream_dev': o_config['pvc']['system']['configuration']['networking']['upstream']['name'],
|
||||||
'upstream_mtu': o_config['pvc']['system']['configuration']['networking']['devices']['upstream']['mtu'],
|
'upstream_mtu': o_config['pvc']['system']['configuration']['networking']['upstream']['mtu'],
|
||||||
'upstream_dev_ip': o_config['pvc']['system']['configuration']['networking']['addresses']['upstream'],
|
'upstream_dev_ip': o_config['pvc']['system']['configuration']['networking']['upstream']['address'],
|
||||||
}
|
}
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print('ERROR: {}!'.format(e))
|
print('ERROR: {}!'.format(e))
|
||||||
|
|
Loading…
Reference in New Issue