---
# file: roles/postgres/tasks/main.yml

- name: ensure postgres packages are installed
  apt: name={{ item }} state=latest
  with_items:
    - postgresql
    - python-psycopg2
    - python3-psycopg2
    - libpq-dev
  tags:
    - packages
    - postgres

- name: ensure postgres is started
  service: name=postgresql state=running enabled=yes
  tags:
    - service
    - postgres
