Replace injected Ansible fact variables with ansible_facts in preinstall role (#13232)

This commit is contained in:
Nikhil Kumar
2026-05-14 16:08:30 +05:30
committed by GitHub
parent 22ce2f799f
commit 2ed677ce86
9 changed files with 41 additions and 38 deletions

View File

@@ -1,7 +1,7 @@
---
- name: Create temporary resolveconf cloud init file
command: cp -f /etc/resolv.conf "{{ resolvconffile }}"
when: ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk"]
when: ansible_facts['os_family'] in ["Flatcar", "Flatcar Container Linux by Kinvolk"]
- name: Add domain/search/nameservers/options to resolv.conf
blockinfile:
@@ -45,7 +45,7 @@
- name: Get temporary resolveconf cloud init file content
command: cat {{ resolvconffile }}
register: cloud_config
when: ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk"]
when: ansible_facts['os_family'] in ["Flatcar", "Flatcar Container Linux by Kinvolk"]
- name: Persist resolvconf cloud init file
template:
@@ -54,4 +54,4 @@
owner: root
mode: "0644"
notify: Preinstall | propagate resolvconf to k8s components
when: ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk"]
when: ansible_facts['os_family'] in ["Flatcar", "Flatcar Container Linux by Kinvolk"]