Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add compatibility for Ubuntu24 #8

Merged
merged 6 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions tasks/pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,17 @@

- name: Install common packages
package:
name: "{{ basic_common_pakages }}"
name: "{{ basic_common_packages }}"

- name: Install extra packages
- name: Set specific packages based on Ubuntu version
set_fact:
specific_packages: >-
{{ ubuntu_22_packages if ansible_distribution == 'Ubuntu' and ansible_distribution_version is version_compare('22', '<=') else
ubuntu_24_packages if ansible_distribution == 'Ubuntu' and ansible_distribution_version is version_compare('24', '>=') else [] }}

- name: Install extra and specific packages
package:
name: "{{ basic_extra_packages }}"
name: "{{ basic_extra_packages + specific_packages }}"
state: present

- name: Ensure Python2 lib are presents (CentOS 7)
Expand All @@ -30,8 +36,17 @@
- python-setuptools
when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '7'

- name: Install pip packages with extra args for Ubuntu 24 or more
pip:
executable: pipx
name: "{{ basic_pip_packages }}"
state: present
extra_args: --break-system-packages
when: ansible_distribution == 'Ubuntu' and ansible_distribution_version is version_compare('24', '>=')

- name: Install pip packages
pip:
executable: pip3
name: "{{ basic_pip_packages }}"
state: present
when: ansible_distribution == 'Ubuntu' and ansible_distribution_version is version_compare('22', '<=')
10 changes: 8 additions & 2 deletions vars/Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ basic_mandatory_packages:
- locales

# Common package that should be installed
basic_common_pakages:
basic_common_packages:
- logrotate
- anacron
- vim
Expand All @@ -53,6 +53,12 @@ basic_common_pakages:
- man-db
- lsof
- pv
- netcat
- iperf3
- smartmontools

ubuntu_22_packages:
- netcat

ubuntu_24_packages:
- netcat-traditional
- pipx
Loading