Hi, 

I am trying to create replication user with following task:

- name: Create replication db user
  postgresql_user:
    name: 'replication'
    encrypted: yes
    role_attr_flags: REPLICATION
    password: "{{ python_hash_test.stdout }}"
  sudo_user: "{{ postgresql_user_name }}"
  when: postgresql_cluster_role == 'primary'
 
I am getting following error: 

failed: [db-replication-test-01] => {"failed": true, "parsed": false}
SUDO-SUCCESS-qmsyqdbxruptclggdkkagqprjjttrgad
Traceback (most recent call last):
  File "/tmp/ansible-tmp-1421851833.88-118514931929145/postgresql_user", 
line 2253, in <module>
    main()
  File "/tmp/ansible-tmp-1421851833.88-118514931929145/postgresql_user", 
line 520, in main
    changed = user_alter(cursor, module, user, password, role_attr_flags, 
encrypted, expires)
  File "/tmp/ansible-tmp-1421851833.88-118514931929145/postgresql_user", 
line 232, in user_alter
    cursor.execute(' '.join(alter), query_password_data)
psycopg2.ProgrammingError: syntax error at or near "REPLICATION"
LINE 1: ...D PASSWORD E'md5xxxxxxxxxxxxxxxxxxxxxxxx' REPLICATIO...
                     
I have no trouble when creating user without param role_attr_flags

- name: Create replication db user
  postgresql_user:
    name: 'replication'
    encrypted: yes
    password: "{{ python_hash_test.stdout }}"
  sudo_user: "{{ postgresql_user_name }}"
  when: postgresql_cluster_role == 'primary'

On server I am using 
 - Python 2.6.6
 - PostgreSQL 9.0.18 on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC) 
4.4.7 20120313 (Red Hat 4.4.7-4), 64-bit
 - python-psycopg2-2.4.6-1.rhel6.x86_64

Does anyone have experience with this module?

Thanks, 
Jakub

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/daeea77c-a967-4acb-91b2-32b7514f6616%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to