This repository holds an Ansible role
that is installable using ansible-galaxy. This role contains
tasks used to install and set up a Postgres database for a Django
deployment. It exists primarily to support the Caktus Django project
template.
More complete documenation can be found in caktus/tequila.
This Ansible role is released under the BSD License. See the LICENSE file for more details.
If you think you've found a bug or are interested in contributing to this project check out tequila-postgresql on Github.
Development sponsored by Caktus Consulting Group, LLC.
Create an ansible.cfg file in your project directory to tell
Ansible where to install your roles (optionally, set the
ANSIBLE_ROLES_PATH environment variable to do the same thing, or
allow the roles to be installed into /etc/ansible/roles)
[defaults] roles_path = deployment/roles/
Create a requirements.yml file in your project's deployment
directory
--- # file: deployment/requirements.yml - src: https://github.com/caktus/tequila-postgresql version: 0.1.0
Run ansible-galaxy with your requirements file
$ ansible-galaxy install -r deployment/requirements.yml
or, alternatively, run it directly against the url
$ ansible-galaxy install git+https://github.com/caktus/tequila-postgresql
The project then should have access to the tequila-postgresql role in
its playbooks.
The following variables are made use of by the tequila-postgresql
role:
project_namerequiredenv_namerequireddb_namedefault:"{{ project_name }}_{{ env_name }}"db_userdefault:"{{ project_name }}_{{ env_name }}"db_passwordrequiredpg_versiondefault: 9.3postgresql_configdefault: empty dictapp_minionsrequired: combined list of web servers and celery worker servers
The app_minions variable can be constructed from Ansible's
inventory information, like
app_minions: "{{ groups['web'] | union(groups['worker']) }}"
in one of your project's variable files.