# PostgreSQL create user module expected to work on windows?

**URL:** <https://forum.ansible.com/t/postgresql-create-user-module-expected-to-work-on-windows/25135>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [July 31, 2017, 12:00pm UTC](https://forum.ansible.com/t/postgresql-create-user-module-expected-to-work-on-windows/25135 "2017-07-31T12:00:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andy\_Redhead](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@Andy\_Redhead](https://forum.ansible.com/u/Andy_Redhead)\
**Post date:** [July 31, 2017, 12:00pm UTC](https://forum.ansible.com/t/postgresql-create-user-module-expected-to-work-on-windows/25135/1 "2017-07-31T12:00:59Z")

</div>

Hi,

I just tried the following in a playbook running against a Win 2016 server that has PostgreSQL 9.6 installed:

- name: create postgresql cmdb user  
postgresql\_user:  
login\_password: “{{ a365\_postgresql\_admin\_password }}”  
name: “{{ a365\_postgresql\_cmdb\_username }}”  
password: “{{ a365\_postgresql\_cmdb\_password }}”  
role\_attr\_flags: SUPERUSER

The execution failed with the message:

FAILED! =\> {“changed”: false, “failed”: true, “module\_stderr”: “#\< CLIXML\r\nAt line:11 char:23\r\n+ except (AttributeError, OSError):\r\n+ ~\r\nMissing argument in parameter list.\r\n\r\nAt line:13 char:3\r\n+ if scriptdir is not None:\r\n+ ~\r\nMissing ‘(’ after ‘if’ in if statement.\r\n\r\nAt line:20 char:3\r\n+ if sys.version\_info \< (3,):\r\n+ ~\r\nMissing ‘(’ after ‘if’ in if statement.\r\n\r\nAt line:20 char:26\r\n+ if sys.version\_info \< (3,):\r\n+ ~\r\nMissing expression after ‘,’.\r\n\r\nAt line:20 char:21\r\n+ if sys.version\_info \< (3,):\r\n+ ~\r\nThe ‘\<’ operator is reserved for future use.\r\n\r\nAt line:27 char:5\r\n+ from io import BytesIO as IOStream\r\n+ ~~~~\r\nThe ‘from’ keyword is not supported in this version of the language.\r\n\r\nAt line:29 char:5\r\n+ from StringIO import StringIO as IOStream\r\n+~~~~ \r\nThe ‘from’ keyword is not supported in this version of the language.\r\n\r\nAt line:31 char:25\r\n+ def invoke\_module(module, modlib\_path, json\_params):\r\n+ ~\r\nMissing argument in parameter list.\r\n\r\nAt line:33 char:7\r\n+ if pythonpath:\r\n+ ~\r\nMissing ‘(’ after ‘if’ in if statement.\r\n\r\nAt line:34 char:57\r\n+ os.environ[‘PYTHONPATH’] = ‘:’.join((modlib\_path, pythonpath) …\r\n+ ~\r\nMissing argument in parameter list.\r\n\r\nNot all parse errors were reported. Correct the reported errors and try again.\r\n + CategoryInfo : ParserError: (🙂 , ParentContainsErrorRecordException\r\n + FullyQualifiedErrorId : MissingArgument\r\n \r\n\r\n\<Objs Version="1.1.0.1" xmlns="[http://schemas.microsoft.com/powershell/2004/04\](http://schemas.microsoft.com/powershell/2004/04%5C)”\>\<Obj S="progress" RefId="0"\>\<TN RefId="0"\>System.Management.Automation.PSCustomObjectSystem.Object\<I64 N="SourceId"\>1\<PR N="Record"\>Preparing modules for first use.0-1-1Completed-1 ", “module\_stdout”: “”, “msg”: “MODULE FAILURE”, “rc”: 1}

I’m a new Ansible user so this doesn’t really mean a lot to me… however this looks like there is some broken code in the module, rather than a config error on my part?

Other commands earlier in the playbook run ok.

Cheers, Andy
