You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

92 lines
2.5 KiB

6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
  1. ---
  2. - name: Update package management cache (zypper) - SUSE
  3. command: zypper -n --gpg-auto-import-keys ref
  4. register: make_cache_output
  5. until: make_cache_output is succeeded
  6. retries: 4
  7. delay: "{{ retry_stagger | random + 3 }}"
  8. when:
  9. - ansible_pkg_mgr == 'zypper'
  10. tags: bootstrap-os
  11. - name: Update package management cache (APT)
  12. apt:
  13. update_cache: yes
  14. cache_valid_time: 3600
  15. when: ansible_os_family == "Debian"
  16. tags:
  17. - bootstrap-os
  18. - name: Remove legacy docker repo file
  19. file:
  20. path: "{{ yum_repo_dir }}/docker.repo"
  21. state: absent
  22. when:
  23. - ansible_distribution in ["CentOS","RedHat","OracleLinux"]
  24. - not is_fedora_coreos
  25. - name: Install python-dnf for latest RedHat versions
  26. command: dnf install -y python-dnf yum
  27. register: dnf_task_result
  28. until: dnf_task_result is succeeded
  29. retries: 4
  30. delay: "{{ retry_stagger | random + 3 }}"
  31. when:
  32. - ansible_distribution == "Fedora"
  33. - ansible_distribution_major_version|int > 21
  34. - ansible_distribution_major_version|int <= 29
  35. - not is_fedora_coreos
  36. changed_when: False
  37. tags:
  38. - bootstrap-os
  39. - name: Install python3-dnf for latest RedHat versions
  40. command: dnf install -y python3-dnf
  41. register: dnf_task_result
  42. until: dnf_task_result is succeeded
  43. retries: 4
  44. delay: "{{ retry_stagger | random + 3 }}"
  45. when:
  46. - ansible_distribution == "Fedora"
  47. - ansible_distribution_major_version|int >= 30
  48. - not is_fedora_coreos
  49. changed_when: False
  50. tags:
  51. - bootstrap-os
  52. - name: Install epel-release on RedHat/CentOS
  53. yum:
  54. name: epel-release
  55. state: present
  56. when:
  57. - ansible_distribution in ["CentOS","RedHat"]
  58. - not is_fedora_coreos
  59. - epel_enabled|bool
  60. tags:
  61. - bootstrap-os
  62. - name: Update common_required_pkgs with ipvsadm when kube_proxy_mode is ipvs
  63. set_fact:
  64. common_required_pkgs: "{{ common_required_pkgs|default([]) + ['ipvsadm', 'ipset'] }}"
  65. when: kube_proxy_mode == 'ipvs'
  66. - name: Install packages requirements
  67. action:
  68. module: "{{ ansible_pkg_mgr }}"
  69. name: "{{ required_pkgs | default([]) | union(common_required_pkgs|default([])) }}"
  70. state: latest
  71. register: pkgs_task_result
  72. until: pkgs_task_result is succeeded
  73. retries: 4
  74. delay: "{{ retry_stagger | random + 3 }}"
  75. when: not (ansible_os_family in ["Flatcar Container Linux by Kinvolk", "ClearLinux"] or is_fedora_coreos)
  76. tags:
  77. - bootstrap-os
  78. - name: Install ipvsadm for ClearLinux
  79. swupd:
  80. name: ipvsadm
  81. state: present
  82. when:
  83. - ansible_os_family in ["ClearLinux"]
  84. - kube_proxy_mode == 'ipvs'