Giter VIP home page Giter VIP logo

postgresql-role's Introduction

Role Name

Ansible role which installs and configures PostgreSQL, extensions, databases and users.

Requirements

CentOS/Rhel 6.x & 7.x / Amazon Linux 2014.09

Role Variables

# Basic settings
postgresql_version: 9.3
postgresql_encoding: 'UTF-8'
postgresql_locale: 'en_US.UTF-8'

postgresql_admin_user: "postgres"
postgresql_default_auth_method: "trust"

postgresql_cluster_name: "main"
postgresql_cluster_reset: false

# List of databases to be created (optional)
postgresql_databases:
  - name: foobar
    hstore: yes         # flag to install the hstore extensions on this database (yes/no)

# List of users to be created (optional)
postgresql_users:
  - name: john
    pass: pass
    encrypted: no       # denotes if the password is already encrypted.

# List of user privileges to be applied (optional)
postgresql_user_privileges:
  - name: john         # user name
    db: foobar         # database
    priv: "ALL"        # privilege string format: example: INSERT,UPDATE/table:SELECT/anothertable:ALL

Dependencies

If you want to use pgtune, you should add epel to your repos_extra list.

Example Playbook

# file: localrepo.yml
- hosts: vagrant
  user: vagrant
  sudo: yes
  sudo_user: root
  roles:
    - PostgreSQL

Amazon Linux Example Playbook

- hosts: tag_your_tag_name
  remote_user: ec2-user
  sudo: yes
  roles:
    - { role: PostgreSQL,
        postgresql_version: 93,
        postgresql_data_directory: /var/lib/pgsql93/data,
        postgresql_conf_directory: /var/lib/pgsql93/data,
        postgresql_external_pid_file: "/var/run/postgresql/{{postgresql_version}}-{{postgresql_cluster_name}}.pid",
        postgresql_logging_collector: on,
        postgresql_unix_socket_directories: [ /var/run/postgresql ],
        join_char: "" } # This is used to deal with Amazon's naming convention for the postgreSQL service

License

MIT

Author Information

postgresql-role's People

Contributors

trikke76 avatar ciphernaut avatar worldofchris avatar avokhmin avatar leevs avatar

Stargazers

steve avatar

Watchers

Will Thames avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.