---
-
  name: Ensure PostgreSQL Python libraries are installed.
  community.general.pacman:
    name: "{{ postgresql_python_library }}"
    state: present

-
  name: Ensure PostgreSQL packages are installed.
  community.general.pacman:
    name: "{{ postgresql_packages }}"
    state: present

-
  name: Ensure all configured locales are present.
  community.general.locale_gen:
    name: "{{ item }}"
    state: "present"
  with_items: "{{ postgresql_locales }}"
  register: locale_gen_result
  notify: Restart postgresql
