Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save glassresistor/cc424356369b6c1ccc4b1a120195fc86 to your computer and use it in GitHub Desktop.

Select an option

Save glassresistor/cc424356369b6c1ccc4b1a120195fc86 to your computer and use it in GitHub Desktop.
The full traceback is:
Traceback (most recent call last):
File "/tmp/ansible_Pa6gvA/ansible_module_postgresql_user.py", line 780, in <module>
main()
File "/tmp/ansible_Pa6gvA/ansible_module_postgresql_user.py", line 733, in main
changed = user_alter(cursor, module, user, password, role_attr_flags, encrypted, expires, no_password_changes)
File "/tmp/ansible_Pa6gvA/ansible_module_postgresql_user.py", line 288, in user_alter
cursor.execute(select, {"user": user})
File "/home/mikela/.conda/envs/playbooks/lib/python2.7/site-packages/psycopg2/extras.py", line 144, in execute
return super(DictCursor, self).execute(query, vars)
psycopg2.ProgrammingError: permission denied for relation pg_authid
fatal: [localhost]: FAILED! => {
"changed": false,
"failed": true,
"module_stderr": "Traceback (most recent call last):\n File \"/tmp/ansible_Pa6gvA/ansible_module_postgresql_user.py\", line 780, in <module>\n main()\n File \"/tmp/ansible_Pa6gvA/ansible_module_postgresql_user.py\", line 733, in main\n changed = user_alter(cursor, module, user, password, role_attr_flags, encrypted, expires, no_password_changes)\n File \"/tmp/ansible_Pa6gvA/ansible_module_postgresql_user.py\", line 288, in user_alter\n cursor.execute(select, {\"user\": user})\n File \"/home/mikela/.conda/envs/playbooks/lib/python2.7/site-packages/psycopg2/extras.py\", line 144, in execute\n return super(DictCursor, self).execute(query, vars)\npsycopg2.ProgrammingError: permission denied for relation pg_authid\n\n",
"module_stdout": "",
"msg": "MODULE FAILURE",
"rc": 0
}
@glassresistor

Copy link
Copy Markdown
Author
- name: Create Application User with DB access
  postgresql_user:
    login_host: "{{ database.instance.endpoint }}"
    login_user: "{{ pg_username }}"
    login_password: "{{ pg_password }}"
    db: intake
    name: "{{ pg_app_username }}"
    password: "{{ pg_app_password }}"
    priv: "CONNECT"
    role_attr_flags: NOSUPERUSER

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment