postgresql-install.yml 530 Bytes
Newer Older
1
---
2
  - name: Install PosgreSQL and libpq-dev packages.
3
    apt: name={{ item }} state=latest
4
    with_items:
5 6
      - postgresql
      - libpq-dev
Georgios Ouzounis's avatar
Georgios Ouzounis committed
7 8 9

  - name: Install Python connector for PostgreSQL.
    pip: name=psycopg2
10 11 12 13 14 15 16 17

  - name: Create PostgreSQL database for service user.
    sudo_user: postgres
    postgresql_db: name={{ database_name }}

  - name: Create PostgreSQL role for lambdaservice user.
    sudo_user: postgres
    postgresql_user: db={{ database_name }} name={{ username }} password={{ database_user_password }}