I am trying to use community.postgresql.postgresql_user to create a user on a brand new database. This fails with an error that just says “MODULE FAILURE se stdout/stderr for the exact error”. When I output stdout/stderr, they say “VARIABLE IS NOT DEFINED!”. The task I am running is:
- name: Config | Create dba user
become: true
become_user: postgres
community.postgresql.postgresql_user:
name: dba
state: present
password: "{{ db_password }}"
role_attr_flags: CREATEDB,SUPERUSER,CREATEROLE
register: createuser
environment:
PGOPTION: "-c password_encryption=scram-sha-256"
However, even when I remove the only line that has a variable in it, it fails with the same error. I am kind of at a loss with this one. If anyone has any ideas, I would greatly appreciate it.