diff --git a/roles/bootstrap-os/tasks/amzn.yml b/roles/bootstrap-os/tasks/amzn.yml index 27121214a..8a473a07f 100644 --- a/roles/bootstrap-os/tasks/amzn.yml +++ b/roles/bootstrap-os/tasks/amzn.yml @@ -14,14 +14,3 @@ enabled: true repo_gpgcheck: false when: epel_enabled - -# iproute is required for networking related facts gathering -# See https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_vars_facts.html#package-requirements-for-fact-gathering -# Note: It is not recommended way, but since the tasks execution order, put it here is the simplest way so far. We can move it to a proper place later. -# TODO: move this to roles/kubernetes/preinstall/vars/main.yml -> pkgs variables -# Currently not possible because the collect the network facts before that step, needs reordering of the exec flow. -- name: Ensure iproute is installed - package: - name: iproute - state: present - become: true diff --git a/roles/bootstrap-os/tasks/centos.yml b/roles/bootstrap-os/tasks/centos.yml index cab18da4a..93816ff2f 100644 --- a/roles/bootstrap-os/tasks/centos.yml +++ b/roles/bootstrap-os/tasks/centos.yml @@ -116,14 +116,3 @@ name: "{{ ((ansible_distribution_major_version | int) < 8) | ternary('libselinux-python', 'python3-libselinux') }}" state: present become: true - -# iproute is required for networking related facts gathering -# See https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_vars_facts.html#package-requirements-for-fact-gathering -# Note: It is not recommended way, but since the tasks execution order, put it here is the simplest way so far. We can move it to a proper place later. -# TODO: move this to roles/kubernetes/preinstall/vars/main.yml -> pkgs variables -# Currently not possible because the collect the network facts before that step, needs reordering of the exec flow. -- name: Ensure iproute is installed - package: - name: iproute - state: present - become: true diff --git a/roles/bootstrap-os/tasks/clear-linux-os.yml b/roles/bootstrap-os/tasks/clear-linux-os.yml index ec87bb2f4..2e41eaa01 100644 --- a/roles/bootstrap-os/tasks/clear-linux-os.yml +++ b/roles/bootstrap-os/tasks/clear-linux-os.yml @@ -14,14 +14,3 @@ daemon_reload: true state: started become: true - -# iproute2 is required for networking related facts gathering -# See https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_vars_facts.html#package-requirements-for-fact-gathering -# Note: It is not recommended way, but since the tasks execution order, put it here is the simplest way so far. We can move it to a proper place later. -# TODO: move this to roles/kubernetes/preinstall/vars/main.yml -> pkgs variables -# Currently not possible because the collect the network facts before that step, needs reordering of the exec flow. -- name: Ensure iproute2 is installed - package: - name: iproute2 - state: present - become: true diff --git a/roles/bootstrap-os/tasks/debian.yml b/roles/bootstrap-os/tasks/debian.yml index fb3202a95..9b18baa06 100644 --- a/roles/bootstrap-os/tasks/debian.yml +++ b/roles/bootstrap-os/tasks/debian.yml @@ -62,14 +62,3 @@ - '"changed its" in bootstrap_update_apt_result.stdout' - '"value from" in bootstrap_update_apt_result.stdout' ignore_errors: true - -# iproute2 is required for networking related facts gathering -# See https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_vars_facts.html#package-requirements-for-fact-gathering -# Note: It is not recommended way, but since the tasks execution order, put it here is the simplest way so far. We can move it to a proper place later. -# TODO: move this to roles/kubernetes/preinstall/vars/main.yml -> pkgs variables -# Currently not possible because the collect the network facts before that step, needs reordering of the exec flow. -- name: Ensure iproute2 is installed - package: - name: iproute2 - state: present - become: true diff --git a/roles/bootstrap-os/tasks/fedora.yml b/roles/bootstrap-os/tasks/fedora.yml index a26280077..d4a43c314 100644 --- a/roles/bootstrap-os/tasks/fedora.yml +++ b/roles/bootstrap-os/tasks/fedora.yml @@ -28,14 +28,3 @@ become: true when: - need_bootstrap.rc != 0 - -# iproute is required for networking related facts gathering -# See https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_vars_facts.html#package-requirements-for-fact-gathering -# Note: It is not recommended way, but since the tasks execution order, put it here is the simplest way so far. We can move it to a proper place later. -# TODO: move this to roles/kubernetes/preinstall/vars/main.yml -> pkgs variables -# Currently not possible because the collect the network facts before that step, needs reordering of the exec flow. -- name: Ensure iproute is installed - package: - name: iproute - state: present - become: true diff --git a/roles/bootstrap-os/tasks/opensuse.yml b/roles/bootstrap-os/tasks/opensuse.yml index f0de009e8..5a4f9dead 100644 --- a/roles/bootstrap-os/tasks/opensuse.yml +++ b/roles/bootstrap-os/tasks/opensuse.yml @@ -83,15 +83,3 @@ - apparmor-parser state: present become: true - -# iproute2 is required for networking related facts gathering -# See https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_vars_facts.html#package-requirements-for-fact-gathering -# Note: It is not recommended way, but since the tasks execution order, put it here is the simplest way so far. We can move it to a proper place later. -# TODO: move this to roles/kubernetes/preinstall/vars/main.yml -> pkgs variables -# Currently not possible because the collect the network facts before that step, needs reordering of the exec flow. -- name: Ensure iproute2 is installed - community.general.zypper: - name: iproute2 - state: present - update_cache: true - become: true diff --git a/roles/bootstrap-os/tasks/rhel.yml b/roles/bootstrap-os/tasks/rhel.yml index ad2c4e962..4e82cd088 100644 --- a/roles/bootstrap-os/tasks/rhel.yml +++ b/roles/bootstrap-os/tasks/rhel.yml @@ -101,14 +101,3 @@ name: "{{ ((ansible_distribution_major_version | int) < 8) | ternary('libselinux-python', 'python3-libselinux') }}" state: present become: true - -# iproute is required for networking related facts gathering -# See https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_vars_facts.html#package-requirements-for-fact-gathering -# Note: It is not recommended way, but since the tasks execution order, put it here is the simplest way so far. We can move it to a proper place later. -# TODO: move this to roles/kubernetes/preinstall/vars/main.yml -> pkgs variables -# Currently not possible because the collect the network facts before that step, needs reordering of the exec flow. -- name: Ensure iproute is installed - package: - name: iproute - state: present - become: true diff --git a/roles/system_packages/vars/main.yml b/roles/system_packages/vars/main.yml index bb98e58df..cde133a4c 100644 --- a/roles/system_packages/vars/main.yml +++ b/roles/system_packages/vars/main.yml @@ -32,6 +32,10 @@ pkgs: - "{{ ansible_distribution == 'Debian' }}" - "{{ ansible_distribution_major_version in ['11', '12'] }}" - "{{ 'k8s_cluster' in group_names }}" + iproute: + - "{{ ansible_os_family == 'RedHat' }}" + iproute2: + - "{{ ansible_os_family != 'RedHat' }}" ipset: - "{{ kube_proxy_mode != 'ipvs' }}" - "{{ 'k8s_cluster' in group_names }}"