run db clear as postgres user, as docker connection method defaults to running as root
Change-Id: I0f7a4452ccaea1c4504ec684feec6a9723b72e01
diff --git a/roles/xos-clear-db/tasks/main.yml b/roles/xos-clear-db/tasks/main.yml
index 3fb46a4..5a6ea18 100644
--- a/roles/xos-clear-db/tasks/main.yml
+++ b/roles/xos-clear-db/tasks/main.yml
@@ -7,7 +7,7 @@
dest: /tmp/xos_clear_db.sql
- name: Run database cleanup script
- command: "psql -U postgres -d xos -f /tmp/xos_clear_db.sql"
+ command: "su postgres -c 'psql -U postgres -d xos -f /tmp/xos_clear_db.sql'"
tags:
- skip_ansible_lint # test scenario destructive script