From e1ab0ec734fd0a17f2b90d1bac5097af35e1122a Mon Sep 17 00:00:00 2001 From: Per Hallgren Date: Tue, 30 Sep 2025 11:33:12 +0200 Subject: [PATCH] fix(debian-ip): include all mapped options as valid options As reported in https://github.com/saltstack/salt/issues/58210 and https://github.com/saltstack/salt/issues/57820, not all options get rendered in the final `interfaces` file. The valid_opts list must be a superset of the keys of the optmap map for the mappted options to get rendered. This commit adds the missing options to the valid_opts list. --- changelog/58210.fixed.md | 1 + salt/templates/debian_ip/debian_eth.jinja | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 changelog/58210.fixed.md diff --git a/changelog/58210.fixed.md b/changelog/58210.fixed.md new file mode 100644 index 000000000000..917e204d17d3 --- /dev/null +++ b/changelog/58210.fixed.md @@ -0,0 +1 @@ +Render post/pre up/down and hwaddr options for debian-ip. See #58210 and #57820. diff --git a/salt/templates/debian_ip/debian_eth.jinja b/salt/templates/debian_ip/debian_eth.jinja index 87ada95467e0..60ebce4070d6 100644 --- a/salt/templates/debian_ip/debian_eth.jinja +++ b/salt/templates/debian_ip/debian_eth.jinja @@ -12,12 +12,13 @@ } -%} {% set concat_opts = ['dns_nameservers'] -%} {% set valid_opts = [ - 'autoconf', 'privext', 'dhcp', 'hwaddress', 'vlan_raw_device', 'address', 'addresses', 'netmask', + 'autoconf', 'privext', 'dhcp', 'hwaddress', 'hwaddr', 'vlan_raw_device', 'address', 'addresses', 'netmask', 'metric', 'gateway', 'pointopoint', 'scope', 'hostname', 'media', 'leasehours', 'leasetime', 'vendor', 'client', 'bootfile', 'server', 'mode', 'endpoint', 'dstaddr', 'local', 'ttl', 'mtu', 'provider', 'unit', 'options', 'master', 'dns_nameservers', 'wireless_mode', 'wpa_ap_scan', 'wpa_conf', 'wpa_driver', 'wpa_group', 'wpa_key_mgmt', 'wpa_pairwise', 'wpa_proto', 'wpa_psk', - 'wpa_roam', 'wpa_ssid', 'accept_ra' + 'wpa_roam', 'wpa_ssid', 'accept_ra', 'up_cmds', 'down_cmds', 'pre_up_cmds', 'post_up_cmds', + 'pre_down_cmds', 'post_down_cmds' ] -%} {% if data.enabled %}auto {{ name }} {% endif %}{% if data.hotplug %}allow-hotplug {{ name }}