canonical / canonical/cloud-init

Inteface level DNS and search information is not getting added to ifcfg file

Open
#5,845 3 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
3.8k
Forks
1.1k
Avg merge
2d 23h
Merged PRs (30d)
18

Description

I have reported this here:
https://github.com/canonical/cloud-init/pull/4756#issuecomment-2440748210

With a config like this:
```
config:
- name: eth0
subnets:
- address: 10.0.2.2/24
gateway: 10.0.2.1
type: static
type: physical
- type: nameserver
interface: eth0
address:
- 8.8.8.8
- 4.4.4.4
search:
- example.com
version: 1
```
We do not see interface level DNS and search information in ifcfg file:
```
[cloud-user@provisioner ~]$ cat /etc/resolv.conf
# Generated by NetworkManager
search ocp.openstack.lab
[cloud-user@provisioner ~]$ nmcli -f NAME,FILENAME c show
NAME FILENAME
System eth0 /etc/sysconfig/network-scripts/ifcfg-eth0
lo /run/NetworkManager/system-connections/lo.nmconnection
[cloud-user@provisioner ~]$ cat /etc/sysconfig/network-scripts/ifcfg-eth0
# Created by cloud-init automatically, do not edit.
#
AUTOCONNECT_PRIORITY=120
BOOTPROTO=none
DEFROUTE=yes
DEVICE=eth0
GATEWAY=10.0.2.1
IPADDR=10.0.2.2
NETMASK=255.255.255.0
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
```
Log file is attached:
[cloud-init.log](https://github.com/user-attachments/files/17538938/cloud-init.log)

We may need to modify sysconfig renderer?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.