postgres.sls 586 Bytes
Newer Older
Guba Sándor committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
postgres_service:
  service.running:
    - name: postgresql

dbuser:
  postgres_user.present:
    - name: {{ pillar['database']['user'] }}
    - password: {{ pillar['database']['password'] }}
    - runas: postgres
    - require:
      - service: postgresql

database:
  postgres_database.present:
    - name: {{ pillar['database']['name'] }}
    - encoding: UTF8
    - lc_ctype: en_US.UTF8
    - lc_collate: en_US.UTF8
    - template: template0
    - owner: {{ pillar['database']['user'] }}
    - runas: postgres
    - require:
      - service: postgresql
      - postgres_user: dbuser