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

Adjust python-apt package to be findable on newer Debian/Ubuntu versions #624

Merged
merged 2 commits into from
Apr 30, 2024

Conversation

Ianvdl
Copy link
Contributor

@Ianvdl Ianvdl commented Apr 2, 2024

At the moment python-apt is installed on Debian-based distros using the following:

 - name: Install python-apt package
   ansible.builtin.package:
     name: python-apt
     state: present
   when:
     - ansible_os_family == 'Debian'

On newer versions of these distros, the python-apt package has been superseded by python3-apt, so the playbook fails at this point. Since all other references in roles/install_dbserver/tasks/validate_install_dbserver.yml are already configured to use the python3 versions, e.g.:

grep python3 roles/install_dbserver/tasks/validate_install_dbserver.yml
        'python3-pycurl', 'python3-libselinux', 'python3-psycopg2', 'glibc-langpack-en'
        'python3-pip', 'python3-psycopg2'
        'ca-certificates', 'python3-pycurl', 'python3-psycopg2', 'postgresql-' + pg_version | string,
        'python3-pip', 'python3-psycopg2', 'edb-as' + pg_version | string + '-server',

We are probably safe to proceed with this change.

@@ -99,7 +99,7 @@

- name: Install python-apt package
ansible.builtin.package:
name: python-apt
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am worried about what would happen to the old version of Debian. Would you like to add a check for the Debian version and, based on that, use python3-apt?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could do that - do you think it's necessary? Debian removed python-apt five years ago, as far as I can tell, along with Python 2.7.

@Ianvdl
Copy link
Contributor Author

Ianvdl commented Apr 17, 2024

Updated the PR to use python-apt for Debian 9 and 10 (Stretch and Buster), and python3-apt for Debian 11 and 12 (Bullseye and Bookworm).

Copy link
Contributor

@vibhorkumar123 vibhorkumar123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@vibhorkumar123 vibhorkumar123 merged commit 3b89a2f into EnterpriseDB:main Apr 30, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants