sysconfig renderer should render DNSx= and GATEWAY= lines
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Fix Released
|
Medium
|
Unassigned |
Bug Description
cloud-init 0.7.9 on CentOS and Fedora are semi-broken because the sysconfig renderer does not render
DNS1=...
GATEWAY=...
into /etc/sysconfig/
This is using NoCloud ENI source -> network_config -> network_state -> sysconfig renderer
From this ENI source:
auto eth0
iface eth0 inet static
address 192.168.125.154
netmask 255.255.255.0
gateway 192.168.125.1
dns-nameservers 192.168.125.1 8.8.8.8 8.8.4.4 1.2.3.4
dns-search example.com foo.biz bar.info foobar.toomany
Actual result:
# Created by cloud-init on instance boot automatically, do not edit.
#
BOOTPROTO=static
DEVICE=eth0
IPADDR=
NETMASK=
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
Expected result:
# Created by cloud-init on instance boot automatically, do not edit.
#
BOOTPROTO=static
DEVICE=eth0
DNS1=192.168.125.1
DNS2=8.8.8.8
DNS3=8.8.4.4
GATEWAY=
HELLO=world
IPADDR=
NETMASK=
ONBOOT=yes
SEARCH="example.com foo.biz info.bar"
TYPE=Ethernet
USERCTL=no
The network_config object:
{'version': 1, 'config': [{'type': 'physical', 'name': 'eth0', 'subnets': [{'_orig_eni_name': 'eth0', 'type': 'static', 'control': 'auto', 'address': '192.168.125.154', 'netmask': '255.255.255.0', 'gateway': '192.168.125.1', 'dns_nameservers': ['192.168.125.1', '8.8.8.8', '8.8.4.4', '1.2.3.4'], 'dns_search': ['example.com', 'foo.biz', 'bar.info', 'foobar.
The network_state object:
!!python/
_network_state:
dns:
search: []
interfaces:
eth0:
inet: inet
mode: manual
mtu: null
name: eth0
- _orig_eni_name: eth0
- 192.168.125.1
- 8.8.8.8
- 8.8.4.4
- 1.2.3.4
- example.com
- foo.biz
- bar.info
- foobar.toomany
type: physical
routes: []
_version: 1
Related branches
- Server Team CI bot: Approve (continuous-integration)
- Scott Moser: Pending requested
-
Diff: 667 lines (+221/-77)15 files modifiedcloudinit/net/dhcp.py (+29/-15)
cloudinit/net/network_state.py (+8/-0)
cloudinit/net/sysconfig.py (+15/-0)
cloudinit/net/tests/test_dhcp.py (+61/-5)
cloudinit/sources/DataSourceAzure.py (+3/-26)
cloudinit/util.py (+22/-0)
debian/changelog (+13/-0)
tests/cloud_tests/images/nocloudkvm.py (+15/-7)
tests/cloud_tests/instances/nocloudkvm.py (+5/-3)
tests/cloud_tests/platforms/nocloudkvm.py (+11/-10)
tests/cloud_tests/releases.yaml (+16/-0)
tests/cloud_tests/setup_image.py (+3/-3)
tests/cloud_tests/snapshots/nocloudkvm.py (+11/-6)
tests/unittests/test_datasource/test_azure.py (+3/-2)
tests/unittests/test_net.py (+6/-0)
- Server Team CI bot: Approve (continuous-integration)
- Scott Moser: Pending requested
-
Diff: 667 lines (+221/-77)15 files modifiedcloudinit/net/dhcp.py (+29/-15)
cloudinit/net/network_state.py (+8/-0)
cloudinit/net/sysconfig.py (+15/-0)
cloudinit/net/tests/test_dhcp.py (+61/-5)
cloudinit/sources/DataSourceAzure.py (+3/-26)
cloudinit/util.py (+22/-0)
debian/changelog (+13/-0)
tests/cloud_tests/images/nocloudkvm.py (+15/-7)
tests/cloud_tests/instances/nocloudkvm.py (+5/-3)
tests/cloud_tests/platforms/nocloudkvm.py (+11/-10)
tests/cloud_tests/releases.yaml (+16/-0)
tests/cloud_tests/setup_image.py (+3/-3)
tests/cloud_tests/snapshots/nocloudkvm.py (+11/-6)
tests/unittests/test_datasource/test_azure.py (+3/-2)
tests/unittests/test_net.py (+6/-0)
- Server Team CI bot: Approve (continuous-integration)
- Scott Moser: Pending requested
-
Diff: 667 lines (+221/-77)15 files modifiedcloudinit/net/dhcp.py (+29/-15)
cloudinit/net/network_state.py (+8/-0)
cloudinit/net/sysconfig.py (+15/-0)
cloudinit/net/tests/test_dhcp.py (+61/-5)
cloudinit/sources/DataSourceAzure.py (+3/-26)
cloudinit/util.py (+22/-0)
debian/changelog (+13/-0)
tests/cloud_tests/images/nocloudkvm.py (+15/-7)
tests/cloud_tests/instances/nocloudkvm.py (+5/-3)
tests/cloud_tests/platforms/nocloudkvm.py (+11/-10)
tests/cloud_tests/releases.yaml (+16/-0)
tests/cloud_tests/setup_image.py (+3/-3)
tests/cloud_tests/snapshots/nocloudkvm.py (+11/-6)
tests/unittests/test_datasource/test_azure.py (+3/-2)
tests/unittests/test_net.py (+6/-0)
- Server Team CI bot: Approve (continuous-integration)
- Scott Moser: Pending requested
-
Diff: 72 lines (+23/-2)3 files modifiedcloudinit/net/network_state.py (+10/-2)
cloudinit/net/sysconfig.py (+7/-0)
tests/unittests/test_net.py (+6/-0)
- Scott Moser: Needs Fixing
- Server Team CI bot: Needs Fixing (continuous-integration)
-
Diff: 73 lines (+26/-2)3 files modifiedcloudinit/net/network_state.py (+13/-2)
cloudinit/net/sysconfig.py (+7/-0)
tests/unittests/test_net.py (+6/-0)
- Server Team CI bot: Needs Fixing (continuous-integration)
- cloud-init Commiters: Pending requested
-
Diff: 42 lines (+13/-0)2 files modifiedcloudinit/net/sysconfig.py (+7/-0)
tests/unittests/test_net.py (+6/-0)
- Server Team CI bot: Pending (continuous-integration) requested
- cloud-init Commiters: Pending requested
-
Diff: 42 lines (+13/-0)2 files modifiedcloudinit/net/sysconfig.py (+7/-0)
tests/unittests/test_net.py (+6/-0)
- Server Team CI bot: Needs Fixing (continuous-integration)
- cloud-init Commiters: Pending requested
-
Diff: 45 lines (+16/-0)2 files modifiedcloudinit/net/sysconfig.py (+10/-0)
tests/unittests/test_net.py (+6/-0)
Changed in cloud-init: | |
status: | Confirmed → Fix Committed |
Tested on ubuntu/zesty branch using net-convert.py. Reproduced on Fedora 26 cloud-init 0.7.9 (a few commits behind without netplan)