diff --git a/roles/container-engine/containerd/defaults/main.yml b/roles/container-engine/containerd/defaults/main.yml index 8316b1840..44ff8409b 100644 --- a/roles/container-engine/containerd/defaults/main.yml +++ b/roles/container-engine/containerd/defaults/main.yml @@ -77,5 +77,26 @@ containerd_limit_mem_lock: "infinity" # If enabled it will use config_path and disable use mirrors config containerd_use_config_path: false +# OS distributions that already support containerd +containerd_supported_distributions: + - "CentOS" + - "OracleLinux" + - "RedHat" + - "Ubuntu" + - "Debian" + - "Fedora" + - "AlmaLinux" + - "Rocky" + - "Amazon" + - "Flatcar" + - "Flatcar Container Linux by Kinvolk" + - "Suse" + - "openSUSE Leap" + - "openSUSE Tumbleweed" + - "Kylin Linux Advanced Server" + - "UnionTech" + - "UniontechOS" + - "openEuler" + # If enabled it will allow kubespray to attempt setup even if the distribution is not supported. For unsupported distributions this can lead to unexpected failures in some cases. allow_unsupported_distribution_setup: false diff --git a/roles/container-engine/containerd/tasks/main.yml b/roles/container-engine/containerd/tasks/main.yml index b219ef758..5ec9c28ac 100644 --- a/roles/container-engine/containerd/tasks/main.yml +++ b/roles/container-engine/containerd/tasks/main.yml @@ -3,7 +3,7 @@ fail: msg: "{{ ansible_distribution }} is not supported by containerd." when: - - not (allow_unsupported_distribution_setup | default(false)) and (ansible_distribution not in ["CentOS", "OracleLinux", "RedHat", "Ubuntu", "Debian", "Fedora", "AlmaLinux", "Rocky", "Amazon", "Flatcar", "Flatcar Container Linux by Kinvolk", "Suse", "openSUSE Leap", "openSUSE Tumbleweed", "Kylin Linux Advanced Server", "UnionTech", "openEuler"]) + - not (allow_unsupported_distribution_setup | default(false)) and (ansible_distribution not in containerd_supported_distributions) - name: containerd | Remove any package manager controlled containerd package package: diff --git a/roles/kubernetes/preinstall/defaults/main.yml b/roles/kubernetes/preinstall/defaults/main.yml index aad2f3394..e1798d9c1 100644 --- a/roles/kubernetes/preinstall/defaults/main.yml +++ b/roles/kubernetes/preinstall/defaults/main.yml @@ -107,3 +107,32 @@ ntp_force_sync_immediately: false # Set the timezone for your server. eg: "Etc/UTC","Etc/GMT-8". If not set, the timezone will not change. ntp_timezone: "" + +# Currently known os distributions +supported_os_distributions: + - 'RedHat' + - 'CentOS' + - 'Fedora' + - 'Ubuntu' + - 'Debian' + - 'Flatcar' + - 'Flatcar Container Linux by Kinvolk' + - 'Suse' + - 'openSUSE Leap' + - 'openSUSE Tumbleweed' + - 'ClearLinux' + - 'OracleLinux' + - 'AlmaLinux' + - 'Rocky' + - 'Amazon' + - 'Kylin Linux Advanced Server' + - 'UnionTech' + - 'UniontechOS' + - 'openEuler' + +# Extending some distributions into the redhat os family +redhat_os_family_extensions: + - "Kylin Linux Advanced Server" + - "openEuler" + - "UnionTech" + - "UniontechOS" diff --git a/roles/kubernetes/preinstall/tasks/0020-verify-settings.yml b/roles/kubernetes/preinstall/tasks/0020-verify-settings.yml index 99f4316ab..ec425a5a0 100644 --- a/roles/kubernetes/preinstall/tasks/0020-verify-settings.yml +++ b/roles/kubernetes/preinstall/tasks/0020-verify-settings.yml @@ -22,9 +22,9 @@ that: ansible_service_mgr == "systemd" when: not ignore_assert_errors -- name: Stop if unknown OS +- name: Stop if the os does not support assert: - that: ansible_distribution in ['RedHat', 'CentOS', 'Fedora', 'Ubuntu', 'Debian', 'Flatcar', 'Flatcar Container Linux by Kinvolk', 'Suse', 'openSUSE Leap', 'openSUSE Tumbleweed', 'ClearLinux', 'OracleLinux', 'AlmaLinux', 'Rocky', 'Amazon', 'Kylin Linux Advanced Server', 'UnionTech', 'openEuler'] + that: ansible_distribution in supported_os_distributions msg: "{{ ansible_distribution }} is not a known OS" when: not ignore_assert_errors diff --git a/roles/kubernetes/preinstall/tasks/0040-set_facts.yml b/roles/kubernetes/preinstall/tasks/0040-set_facts.yml index e1b8605cd..716d4c936 100644 --- a/roles/kubernetes/preinstall/tasks/0040-set_facts.yml +++ b/roles/kubernetes/preinstall/tasks/0040-set_facts.yml @@ -10,7 +10,7 @@ set_fact: ansible_os_family: "RedHat" ansible_distribution_major_version: "8" - when: ansible_distribution in ["Kylin Linux Advanced Server", "openEuler"] + when: ansible_distribution in redhat_os_family_extensions tags: - facts