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

Fix/#111 #112

Merged
merged 3 commits into from
May 15, 2023
Merged

Fix/#111 #112

merged 3 commits into from
May 15, 2023

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

Signed-off-by: Anis FATHALLAH <anis@fathallah.fr>
Signed-off-by: Anis FATHALLAH <anis@fathallah.fr>
Signed-off-by: Anis FATHALLAH <anis@fathallah.fr>
@wmudge wmudge requested a review from a team May 11, 2023 18:47
@wmudge wmudge added the bug Something isn't working 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
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 Something isn't working validated
Development

Successfully merging this pull request may close these issues.

2 participants