PostgreSQL create user module expected to work on windows?

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: (:slight_smile: , 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\”><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