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

ED-1325 - install python-psycopg2 based on ansible distribution #1604

Open
wants to merge 1 commit into
base: release-5.1.1
Choose a base branch
from
Open
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
13 changes: 12 additions & 1 deletion ansible/roles/postgres-db-update/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
- name: Install PostgreSQL client
apt: name={{ item }} update_cache=yes cache_valid_time=36000 state=installed
with_items:
- python-psycopg2
- postgresql-client
ignore_errors: yes

- name: install python-psycopg2
package:
name: python-psycopg2
state: present
when: ansible_distribution_version | float < 20

- name: install python3-psycopg2
package:
name: python3-psycopg2
state: present
when: ansible_distribution_version | float > 20

- name: Ensure database is created
postgresql_db: name="{{ postgres.db_name }}" \
login_host="{{ postgres.db_url }}" \
Expand Down