ansible role for postgresql
Go to file
Jeff Geerling dbd07263e0 Issue #2: Another batch of fixes, mostly for CentOS 6. 2016-09-29 22:37:00 -05:00
defaults Issue #2: Another batch of fixes, mostly for CentOS 6. 2016-09-29 22:37:00 -05:00
handlers So many fixes for Ubuntu and Debian. 2016-09-29 20:01:39 -05:00
meta Initial commit for Ubuntu, Debian, and RHEL/CentOS. 2016-09-29 11:03:13 -05:00
tasks Issue #2: Another batch of fixes, mostly for CentOS 6. 2016-09-29 22:37:00 -05:00
templates Fix broken tests, add Debian 8 test. 2016-09-29 14:33:39 -05:00
tests Fix broken tests, add Debian 8 test. 2016-09-29 14:33:39 -05:00
vars Issue #2: Another batch of fixes, mostly for CentOS 6. 2016-09-29 22:37:00 -05:00
.travis.yml Issue #2: Continue to pick up the mess. 2016-09-29 22:16:48 -05:00
README.md So many fixes for Ubuntu and Debian. 2016-09-29 20:01:39 -05:00

README.md

Ansible Role: PostgreSQL

Build Status

Installs and configures PostgreSQL server on RHEL/CentOS or Debian/Ubuntu servers.

Requirements

No special requirements; note that this role requires root access, so either run it in a playbook with a global become: yes, or invoke the role in your playbook like:

- hosts: database
  roles:
    - role: geerlingguy.postgresql
      become: yes

Role Variables

Available variables are listed below, along with default values (see defaults/main.yml):

postgresql_enablerepo: ""

TODO.

postgresql_user: postgres
postgresql_group: postgres

TODO.

postgresql_databases:
  - name: example
    lc_collate: 'en_US.UTF-8' # optional
    lc_ctype: 'en_US.UTF-8' # optional
    encoding: 'UTF-8' # optional
    login_host: example.com # optional, defaults to 'localhost'
    login_password: supersecure # optional
    login_user: admin # optional, defaults to "{{ postgresql_user }}"
    port: 5432 # optional

TODO.

postgresql_users:
  - name: jdoe
    password: supersecure # optional
    login_host: example.com # optional, defaults to 'localhost'
    login_password: supersecure # optional
    login_user: admin # optional, defaults to "{{ postgresql_user }}"
    port: 1234 # optional, defaults to 5432
    priv: table:priv1,priv2 # optional
    role_attr_flags: CREATEDB,NOSUPERUSER # optional
    state: present # optional

TODO.

postgresql_version: [OS-specific]
postgresql_bin_path: [OS-specific]
postgresql_daemon: [OS-specific]
postgresql_packages: [OS-specific]

TODO.

Dependencies

None.

Example Playbook

- hosts: database
  become: yes
  vars_files:
    - vars/main.yml
  roles:
    - geerlingguy.postgresql

Inside vars/main.yml:

postgresql_databases:
  - name: example_db
postgresql_users:
  - name: example_user
    password: similarly-secure-password

License

MIT / BSD

Author Information

This role was created in 2016 by Jeff Geerling, author of Ansible for DevOps.