fix: skip None resolvconf paths on Ansible Core 2.19 (#13557)

Empty base/head facts render to None on Ansible Core 2.19, which
difference(['']) does not remove. Use select to drop both.

Co-authored-by: Shuu <shuu.n@protonmail.com>
This commit is contained in:
k8s-infra-cherrypick-robot
2026-09-24 06:54:19 +00:00
committed by GitHub
co-authored by Shuu
parent b33027ba09
commit 25be587fdd
@@ -27,7 +27,7 @@
regexp: '^{{ item[1] }}[^#]*(?=# Ansible entries BEGIN)' regexp: '^{{ item[1] }}[^#]*(?=# Ansible entries BEGIN)'
backup: "{{ not resolvconf_stat.stat.islnk }}" backup: "{{ not resolvconf_stat.stat.islnk }}"
with_nested: with_nested:
- "{{ [resolvconffile, base | default(''), head | default('')] | difference(['']) }}" - "{{ [resolvconffile, base | default(''), head | default('')] | select | list }}"
- [ 'search\s', 'nameserver\s', 'domain\s', 'options\s' ] - [ 'search\s', 'nameserver\s', 'domain\s', 'options\s' ]
notify: Preinstall | propagate resolvconf to k8s components notify: Preinstall | propagate resolvconf to k8s components
@@ -38,7 +38,7 @@
replace: '\1' replace: '\1'
backup: "{{ not resolvconf_stat.stat.islnk }}" backup: "{{ not resolvconf_stat.stat.islnk }}"
with_nested: with_nested:
- "{{ [resolvconffile, base | default(''), head | default('')] | difference(['']) }}" - "{{ [resolvconffile, base | default(''), head | default('')] | select | list }}"
- [ 'search\s', 'nameserver\s', 'domain\s', 'options\s' ] - [ 'search\s', 'nameserver\s', 'domain\s', 'options\s' ]
notify: Preinstall | propagate resolvconf to k8s components notify: Preinstall | propagate resolvconf to k8s components