Fixes #9: Make PostgreSQL Python library configurable so Python 3 can work.

This commit is contained in:
Jeff Geerling 2017-06-30 23:12:44 -05:00
parent c4e3716bd0
commit e2d91420e2
4 changed files with 19 additions and 4 deletions

View File

@ -21,6 +21,10 @@ Available variables are listed below, along with default values (see `defaults/m
(RHEL/CentOS only) You can set a repo to use for the PostgreSQL installation by passing it in here.
postgresql_python_library: python-psycopg2
Library used by Ansible to communicate with PostgreSQL. If you are using Python 3 (e.g. set via `ansible_python_interpreter`), you should change this to `python3-psycopg2`.
postgresql_user: postgres
postgresql_group: postgres

View File

@ -2,6 +2,7 @@
# RHEL/CentOS only. Set a repository to use for PostgreSQL installation.
postgresql_enablerepo: ""
postgresql_python_library: python-psycopg2
postgresql_user: postgres
postgresql_group: postgres

View File

@ -1,9 +1,13 @@
---
- name: Ensure PostgreSQL Python libraries are installed.
apt: "name=python-psycopg2 state=installed"
apt:
name: "{{ postgresql_python_library }}"
state: installed
- name: Ensure PostgreSQL packages are installed.
apt: "name={{ item }} state=installed"
apt:
name: "{{ item }}"
state: installed
with_items: "{{ postgresql_packages }}"
- name: Ensure all configured locales are present.

View File

@ -1,7 +1,13 @@
---
- name: Ensure PostgreSQL packages are installed.
package: "name={{ item }} state=installed enablerepo={{ postgresql_enablerepo }}"
package:
name: "{{ item }}"
state: installed
enablerepo: "{{ postgresql_enablerepo }}"
with_items: "{{ postgresql_packages }}"
- name: Ensure PostgreSQL Python libraries are installed.
package: "name=python-psycopg2 state=installed enablerepo={{ postgresql_enablerepo }}"
package:
name: "{{ postgresql_python_library }}"
state: installed
enablerepo: "{{ postgresql_enablerepo }}"