I see that you're supplying multiple SQL statements at the 'query' parameter.
I don't know the module that well, but it could be that that is not supported?
In that case, probably you could loop over a list of queries:
- name: DELETE POSTGRESQL ROLE
community.postgresql.postgresql_query:
login_host: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
db: db_test
login_user: master
login_password: 0123456789
query: GRANT %(role)s TO %(admin)s; REASSIGN OWNED BY %(role)s TO
%(admin)s; DROP OWNED BY %(role)s; DROP ROLE %(role)s;
named_args:
role: delete-user
admin: master
loop:
- GRANT %(role)s TO %(admin)s;
- REASSIGN OWNED BY %(role)s TO %(admin)s;
- DROP OWNED BY %(role)s;
- DROP ROLE %(role)s;
(not tried, ymmv)
> --
> You received this message because you are subscribed to the Google Groups "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
ansible-proje...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/a09bb040-e64e-4bc1-aaa8-325c4af22fbcn%40googlegroups.com.
--
Dick Visser
Trust & Identity Service Operations Manager
GÉANT