# File: roles/postgresql/tasks/packages.yml
---
# Must be installed before PostgreSQL
- name: 'Install locales-all'
  apt:
    pkg: 'locales-all'
    state: present
  tags:
    - packages

- name: 'Install PostgreSQL'
  apt:
    pkg: "{{item}}"
    state: present
  with_items: packages_postgresql
  tags:
    - packages

# File: roles/postgresql/tasks/packages.yml
---
# Must be installed before PostgreSQL
- name: 'Install locales-all in Debian'
  apt:
    pkg: 'locales-all'
    state: present
  when: ansible_distribution == 'Debian'
  tags:
    - packages

- name: 'Install PostgreSQL'
  apt:
    pkg: "{{item}}"
    state: present
  with_items: packages_postgresql
  tags:
    - packages

Install 'locales-all' only in Debian
Install 'locales-all' only in Debian
