Skip to content

Conversation

@anisf
Copy link
Contributor

@anisf anisf commented Apr 28, 2023

Ensure psycopg2 is installed before running ansible modules that depends on it

Fixing #111

On RHEL 7, yum package is python-psycopg2
On RHEL 8, Ubuntu 18.04 & 20.40, apt package is python3-psycopg2

At the moment, these are the only OS supported by cloudera.cluster

anisf added 3 commits April 28, 2023 22:03
Signed-off-by: Anis FATHALLAH <[email protected]>
Signed-off-by: Anis FATHALLAH <[email protected]>
@github-actions github-actions bot added the validated The pull request has passed the prechecks label Apr 28, 2023
@github-actions github-actions bot added validated The pull request has passed the prechecks and removed validated The pull request has passed the prechecks labels Apr 28, 2023
@wmudge wmudge requested a review from a team May 11, 2023 18:47
@wmudge wmudge added the bug POINT - Bugfix entry in the CHANGELOG label May 11, 2023
package:
name: "{{ ((hostvars[item]['ansible_os_family'] == 'RedHat') and (hostvars[item]['ansible_distribution_major_version'] == '7')) | ternary('python-psycopg2', 'python3-psycopg2') }}"
with_items: "{{ databases | json_query('*.host') | unique }}"
delegate_to: "{{ item }}"
Copy link
Member

Choose a reason for hiding this comment

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

This should be run as a task vs an inventory group. Why not modify cloudera.cluster.infrastructure.rdbms?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This fix is only useful if cloudera.cluster.infrastructure.rdbms is not run
psycopg2 is already installed in cloudera.cluster.infrastructure.rdbms

Copy link
Member

Choose a reason for hiding this comment

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

I dug into this a bit more; this application pattern is rife throughout this role, for better or worse.

@wmudge
Copy link
Member

wmudge commented May 11, 2023

@anisf could you set up your signature verification -- looks like you just need to upload your GPG key to your GH account. Thanks!

@anisf anisf closed this May 12, 2023
@anisf anisf deleted the fix/#111 branch May 12, 2023 17:35
@anisf anisf restored the fix/#111 branch May 12, 2023 17:36
@anisf
Copy link
Contributor Author

anisf commented May 12, 2023

@anisf could you set up your signature verification -- looks like you just need to upload your GPG key to your GH account. Thanks!

Done !

@anisf anisf reopened this May 12, 2023
@github-actions github-actions bot added validated The pull request has passed the prechecks and removed validated The pull request has passed the prechecks labels May 12, 2023
package:
name: "{{ ((hostvars[item]['ansible_os_family'] == 'RedHat') and (hostvars[item]['ansible_distribution_major_version'] == '7')) | ternary('python-psycopg2', 'python3-psycopg2') }}"
with_items: "{{ databases | json_query('*.host') | unique }}"
delegate_to: "{{ item }}"
Copy link
Member

Choose a reason for hiding this comment

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

I dug into this a bit more; this application pattern is rife throughout this role, for better or worse.

@wmudge wmudge merged commit d35f3d1 into cloudera-labs:devel May 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug POINT - Bugfix entry in the CHANGELOG validated The pull request has passed the prechecks

Development

Successfully merging this pull request may close these issues.

2 participants