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

[ansible/postgres] Missing python3-psycopg2 for RHEL9 #418

Open
EmptyByte opened this issue Oct 24, 2024 · 0 comments
Open

[ansible/postgres] Missing python3-psycopg2 for RHEL9 #418

EmptyByte opened this issue Oct 24, 2024 · 0 comments

Comments

@EmptyByte
Copy link

EmptyByte commented Oct 24, 2024

This role was never tested nor executed on a Centos 9 or RHEL9 I guess the role fails with

  "msg": "Failed to import the required Python library (psycopg2) on xxx's Python /usr/bin/python3. Please read the module documentation and install it in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter",

This task:

- name: Install python3-psycopg2
  become: true
  ansible.builtin.yum:
    name: python3-psycopg2
    state: present
  when: ansible_distribution_major_version == '8'

Needs to become:

- name: Install python3-psycopg2
  become: true
  ansible.builtin.dnf:
    name: python3-psycopg2
    state: present
  when: ansible_facts['distribution_major_version'] | int in [8, 9]
  • Yum ansible module is deprecated in RHEL8 and 9 and 7 is EOL. Also because this task should be executed on 8 there is no need to use yum.
  • The version comparison should check for 8 or 9 otherwise the create_user task will fail on RHEL9.
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

No branches or pull requests

1 participant