postgresql-install.yml 560 Bytes
Newer Older
1
---
2 3 4 5 6
  - name: Install PosgreSQL and libpq-dev packages.
    apt: name={{ item.name }} state=latest
    with_items:
      - { name: 'postgresql' }
      - { name: '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 }}