File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717
1818- name : Install common packages
1919 package :
20- name : " {{ basic_common_pakages }}"
20+ name : " {{ basic_common_packages }}"
2121
22- - name : Install extra packages
22+ - name : Set specific packages based on Ubuntu version
23+ set_fact :
24+ specific_packages : >-
25+ {{ ubuntu_22_packages if ansible_distribution == 'Ubuntu' and ansible_distribution_version is version_compare('22', '<=') else
26+ ubuntu_24_packages if ansible_distribution == 'Ubuntu' and ansible_distribution_version is version_compare('24', '>=') else [] }}
27+
28+ - name : Install extra and specific packages
2329 package :
24- name : " {{ basic_extra_packages }}"
30+ name : " {{ basic_extra_packages + specific_packages }}"
2531 state : present
2632
2733- name : Ensure Python2 lib are presents (CentOS 7)
3036 - python-setuptools
3137 when : ansible_distribution == 'CentOS' and ansible_distribution_major_version == '7'
3238
39+ - name : Install pip packages with extra args for Ubuntu 24 or more
40+ pip :
41+ executable : pipx
42+ name : " {{ basic_pip_packages }}"
43+ state : present
44+ extra_args : --break-system-packages
45+ when : ansible_distribution == 'Ubuntu' and ansible_distribution_version is version_compare('24', '>=')
46+
3347- name : Install pip packages
3448 pip :
3549 executable : pip3
3650 name : " {{ basic_pip_packages }}"
3751 state : present
52+ when : ansible_distribution == 'Ubuntu' and ansible_distribution_version is version_compare('22', '<=')
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ basic_mandatory_packages:
2626 - locales
2727
2828# Common package that should be installed
29- basic_common_pakages :
29+ basic_common_packages :
3030 - logrotate
3131 - anacron
3232 - vim
@@ -53,6 +53,12 @@ basic_common_pakages:
5353 - man-db
5454 - lsof
5555 - pv
56- - netcat
5756 - iperf3
5857 - smartmontools
58+
59+ ubuntu_22_packages :
60+ - netcat
61+
62+ ubuntu_24_packages :
63+ - netcat-traditional
64+ - pipx
You can’t perform that action at this time.
0 commit comments