psycopg2.ProgrammingError: conflicting or redundant options

2,724 views
Skip to first unread message

John Oliver

unread,
Jul 24, 2014, 1:13:47 PM7/24/14
to ansible...@googlegroups.com
ansible 1.6.6

This stanza in my playbook:

  - name: Create database user
    postgresql_user: name={{rc_db_user}}
                     password={{rc_db_pass}}
                     role_attr_flags=NOSUPERUSER,NOCREATEROLE,NOCREATEUSER,NOCREATEDB
                     login_user={{pg_user}}
                     login_password={{pg_pass}}


Results in:

TASK: [Create database user] ************************************************** 
failed: [jedis-test] => {"failed": true, "parsed": false}
invalid output was: SUDO-SUCCESS-cgtcsjketcpyopmfjrlmiidxvqxogoai
Traceback (most recent call last):
  File "/home/joliver/.ansible/tmp/ansible-tmp-1406221646.88-85343250424775/postgresql_user", line 1743, in <module>
    main()
  File "/home/joliver/.ansible/tmp/ansible-tmp-1406221646.88-85343250424775/postgresql_user", line 499, in main
    changed = user_add(cursor, user, password, role_attr_flags, encrypted, expires)
  File "/home/joliver/.ansible/tmp/ansible-tmp-1406221646.88-85343250424775/postgresql_user", line 181, in user_add
    cursor.execute(query, query_password_data)
psycopg2.ProgrammingError: conflicting or redundant options


I used ANSIBLE_KEEP_REMOTE_FILES=1 to look at those lines, but I'm no python or postgresql guru.

John Oliver

unread,
Jul 24, 2014, 6:47:01 PM7/24/14
to ansible...@googlegroups.com
OK, I'm going to answer my own question :-)  I got the "conflicting or redundant options" when I used a command:  It turns out that NOSUPERUSER is sufficient, and psycopg just throws a fit instead of accepting the "redundant" permissions.

Michael DeHaan

unread,
Jul 24, 2014, 7:39:28 PM7/24/14
to ansible...@googlegroups.com
Yeah we should totally catch the Exception and make it look friendly in output regardless, can you file a github ticket on that?

We like to treat python tracebacks as bugs even if they are informing someone of an error condition.

Thanks!




On Thu, Jul 24, 2014 at 6:47 PM, John Oliver <jno...@gmail.com> wrote:
OK, I'm going to answer my own question :-)  I got the "conflicting or redundant options" when I used a command:  It turns out that NOSUPERUSER is sufficient, and psycopg just throws a fit instead of accepting the "redundant" permissions.

--
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 post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/738bc12a-3448-410b-ab8c-890f0f1b5357%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages