Skip to content

Commit d754d22

Browse files
authored
Merge pull request #8 from steamulo/add-compatibility-for-ubuntu24
feat: add compatibility for Ubuntu24
2 parents 082f5cc + 29d3ee5 commit d754d22

2 files changed

Lines changed: 26 additions & 5 deletions

File tree

tasks/pkg.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,17 @@
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)
@@ -30,8 +36,17 @@
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', '<=')

vars/Debian.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)