gva/salt/roots/gnuviechadmin/database.sls
Jan Dittberner 68170f7576 enable rabbitmq management and add admin permissions
- allow database creation for gnuviechadmin user in local deployments to
  allow test runs
- set administrator tag for gnuviechadmin user in rabbitmq
- add all permissions on gnuviechadmin vhost to gnuviechadmin user
- enable rabbitmq management plugin
2015-10-11 15:28:23 +02:00

33 lines
1.2 KiB
Text

include:
- postgresql-server
gnuviechadmin-database:
postgres_user.present:
- name: {{ salt['pillar.get']('gnuviechadmin-database:owner:user') }}
- user: postgres
- password: {{ salt['pillar.get']('gnuviechadmin-database:owner:password') }}
- login: True
- createdb: {% if salt['pillar.get']('gnuviechadmin:deploymenttype', 'production') == 'local' %}True
{%- else %}False
{%- endif %}
- require:
- service: postgresql
postgres_database.present:
- name: {{ salt['pillar.get']('gnuviechadmin-database:database') }}
- user: postgres
- owner: {{ salt['pillar.get']('gnuviechadmin-database:owner:user') }}
- encoding: UTF8
- template: template0
- require:
- service: postgresql
- postgres_user: {{ salt['pillar.get']('gnuviechadmin-database:owner:user') }}
{% for gnuviechadmin_db_role in salt['pillar.get']('gnuviechadmin-database:users') %}
gnuviechadmin-dbuser-{{ gnuviechadmin_db_role }}:
postgres_user.present:
- name: {{ salt['pillar.get']('gnuviechadmin-database:users:' + gnuviechadmin_db_role + ':user') }}
- password: {{ salt['pillar.get']('gnuviechadmin-database:users:' + gnuviechadmin_db_role + ':password') }}
- login: True
- require:
- service: postgresql
{% endfor %}