---
- name: Install pgsql-server
  package:
    name:
      - libpq-dev
      - postgresql-9.6
      - postgresql-contrib-9.6
      - postgresql-server-dev-9.6
      - python-psycopg2
    state: present

---
- name: Install pgsql-server
  package:
    name:
      - libpq-dev
      - postgresql-9.6
      - postgresql-contrib-9.6
      - postgresql-server-dev-9.6
      - python3-psycopg2
    state: present

Use py3 for postgresql 9.6
Use py3 for postgresql 9.6

Change-Id: I2217a75107dd16e80427621b360d6ac237dda346
