Fix kubespray flatcar ansible_os_family and ansible_distribution (#8181)

Closes https://github.com/kubernetes-sigs/kubespray/issues/8028

Signed-off-by: Iago Santos <iago.santos.pardo@adfinis.com>
This commit is contained in:
Iago Santos
2021-11-19 16:58:51 +01:00
committed by GitHub
parent 2b7247f842
commit f4dae74117
25 changed files with 48 additions and 48 deletions

View File

@@ -26,7 +26,7 @@
args:
creates: "{{ bin_dir }}/socat"
when:
- ansible_os_family in ['Flatcar Container Linux by Kinvolk']
- ansible_os_family in ['Flatcar', 'Flatcar Container Linux by Kinvolk']
- container_manager == "docker"
- name: install | Copy socat wrapper for Container Linux with Containerd
@@ -34,7 +34,7 @@
args:
creates: "{{ bin_dir }}/socat"
when:
- ansible_os_family in ['Flatcar Container Linux by Kinvolk']
- ansible_os_family in ['Flatcar', 'Flatcar Container Linux by Kinvolk']
- container_manager == "containerd"
- name: install | Copy socat wrapper for Container Linux with crio
@@ -42,5 +42,5 @@
args:
creates: "{{ bin_dir }}/socat"
when:
- ansible_os_family in ['Flatcar Container Linux by Kinvolk']
- ansible_os_family in ['Flatcar', 'Flatcar Container Linux by Kinvolk']
- container_manager == "crio"

View File

@@ -9,18 +9,18 @@
- Preinstall | restart kube-controller-manager crio/containerd
- Preinstall | restart kube-apiserver docker
- Preinstall | restart kube-apiserver crio/containerd
when: not ansible_os_family in ["Flatcar Container Linux by Kinvolk"] and not is_fedora_coreos
when: not ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk"] and not is_fedora_coreos
- name: Preinstall | update resolvconf for Flatcar Container Linux by Kinvolk
command: /bin/true
notify:
- Preinstall | apply resolvconf cloud-init
- Preinstall | reload kubelet
when: ansible_os_family in ["Flatcar Container Linux by Kinvolk"]
when: ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk"]
- name: Preinstall | apply resolvconf cloud-init
command: /usr/bin/coreos-cloudinit --from-file {{ resolveconf_cloud_init_conf }}
when: ansible_os_family in ["Flatcar Container Linux by Kinvolk"]
when: ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk"]
- name: Preinstall | update resolvconf for Fedora CoreOS
command: /bin/true

View File

@@ -24,7 +24,7 @@
- name: Stop if unknown OS
assert:
that: ansible_distribution in ['RedHat', 'CentOS', 'Fedora', 'Ubuntu', 'Debian', 'Flatcar Container Linux by Kinvolk', 'Suse', 'openSUSE Leap', 'ClearLinux', 'OracleLinux', 'AlmaLinux', 'Amazon']
that: ansible_distribution in ['RedHat', 'CentOS', 'Fedora', 'Ubuntu', 'Debian', 'Flatcar', 'Flatcar Container Linux by Kinvolk', 'Suse', 'openSUSE Leap', 'ClearLinux', 'OracleLinux', 'AlmaLinux', 'Amazon']
msg: "{{ ansible_distribution }} is not a known OS"
when: not ignore_assert_errors
@@ -337,7 +337,7 @@
- name: Stop if download_localhost is enabled for Flatcar Container Linux
assert:
that: ansible_os_family not in ["Flatcar Container Linux by Kinvolk"]
that: ansible_os_family not in ["Flatcar", "Flatcar Container Linux by Kinvolk"]
msg: "download_run_once not supported for Flatcar Container Linux"
when: download_run_once or download_force_cache

View File

@@ -2,7 +2,7 @@
- name: Force binaries directory for Flatcar Container Linux by Kinvolk
set_fact:
bin_dir: "/opt/bin"
when: ansible_os_family in ["Flatcar Container Linux by Kinvolk"]
when: ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk"]
tags:
- facts
@@ -75,12 +75,12 @@
{%- if resolvconf|bool -%}/etc/resolvconf/resolv.conf.d/base{%- endif -%}
head: >-
{%- if resolvconf|bool -%}/etc/resolvconf/resolv.conf.d/head{%- endif -%}
when: not ansible_os_family in ["Flatcar Container Linux by Kinvolk"] and not is_fedora_coreos
when: not ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk"] and not is_fedora_coreos
- name: target temporary resolvconf cloud init file (Flatcar Container Linux by Kinvolk / Fedora CoreOS)
set_fact:
resolvconffile: /tmp/resolveconf_cloud_init_conf
when: ansible_os_family in ["Flatcar Container Linux by Kinvolk"] or is_fedora_coreos
when: ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk"] or is_fedora_coreos
- name: check if /etc/dhclient.conf exists
stat:

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 Container Linux by Kinvolk"]
when: ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk"]
- name: Add domain/search/nameservers/options to resolv.conf
blockinfile:
@@ -46,7 +46,7 @@
- name: get temporary resolveconf cloud init file content
command: cat {{ resolvconffile }}
register: cloud_config
when: ansible_os_family in ["Flatcar Container Linux by Kinvolk"]
when: ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk"]
- name: persist resolvconf cloud init file
template:
@@ -55,4 +55,4 @@
owner: root
mode: 0644
notify: Preinstall | update resolvconf for Flatcar Container Linux by Kinvolk
when: ansible_os_family in ["Flatcar Container Linux by Kinvolk"]
when: ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk"]

View File

@@ -63,7 +63,7 @@
until: pkgs_task_result is succeeded
retries: "{{ pkg_install_retries }}"
delay: "{{ retry_stagger | random + 3 }}"
when: not (ansible_os_family in ["Flatcar Container Linux by Kinvolk", "ClearLinux"] or is_fedora_coreos)
when: not (ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk", "ClearLinux"] or is_fedora_coreos)
tags:
- bootstrap-os

View File

@@ -33,7 +33,7 @@
mode: 0644
when:
- disable_ipv6_dns
- not ansible_os_family in ["Flatcar Container Linux by Kinvolk"]
- not ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk"]
tags:
- bootstrap-os

View File

@@ -75,7 +75,7 @@
when:
- dns_mode != 'none'
- resolvconf_mode == 'host_resolvconf'
- not ansible_os_family in ["Flatcar Container Linux by Kinvolk"]
- not ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk"]
tags:
- bootstrap-os
- resolvconf
@@ -84,7 +84,7 @@
when:
- dns_mode != 'none'
- resolvconf_mode != 'host_resolvconf'
- not ansible_os_family in ["Flatcar Container Linux by Kinvolk"]
- not ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk"]
tags:
- bootstrap-os
- resolvconf