mirror of
https://github.com/geerlingguy/ansible-role-postgresql.git
synced 2025-03-10 17:26:20 -04:00
Fixes #9: Make PostgreSQL Python library configurable so Python 3 can work.
This commit is contained in:
parent
c4e3716bd0
commit
e2d91420e2
4 changed files with 19 additions and 4 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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 }}"
|
||||
|
|
Loading…
Add table
Reference in a new issue