Microsoft SQL Server Module mssql_db Not Working to create a Database.

ISSUE TYPE

  • Feature Idea
    COMPONENT NAME- API
    SUMMARY

When I am using the SQL Server Module mssql_db to create a new database on the microsoft SQL Server I am getting the below error. Microsoft SQL Server is on windows server. I am using the below playbook to create the database on SQL Server.

Ansible Playbook :

  • hosts: SQLSERVER
    vars:
    ansible_python_interpreter: /usr/bin/Python 2.7.5
    tasks:
    • mssql_db:
      debug: var=ansible_host
      login_host: *******
      login_user: Ansible
      login_password: *******
      login_port: 1433
      name: TestDB
      state: present

ERROR : fatal: [SQLSERVER]: FAILED! => {“changed”: false, “module_stderr”: "Exception calling “Create” with “1” argument(s): “At line:4 char:21\r\n+ def _ansiballz_main():\r\n+ ~\r\nAn expression was expected after ‘(’.\r\nAt line:13 char:27\r\n+ except (AttributeError, OSError):\r\n+ ~\r\nMissing argument in parameter list.\r\nAt line:15 char:7\r\n+ if scriptdir is not None:\r\n+ ~\r\nMissing ‘(’ after ‘if’ in if statement.\r\nAt line:22 char:7\r\n+ if sys.version_info < (3,):\r\n+ ~\r\nMissing ‘(’ after ‘if’ in if statement.\r\nAt line:22 char:30\r\n+ if sys.version_info < (3,):\r\n+ ~\r\nMissing expression after ‘,’.\r\nAt line:22 char:25\r\n+ if sys.version_info < (3,):\r\n+ ~\r\nThe ‘<’ operator is reserved for future use.\r\nAt line:27 char:34\r\n+ def invoke_module(modlib_path, temp_path, json_params):\r\n+ ~\r\nMissing argument in parameter list.\r\nAt line:28 char:40\r\n+ z = zipfile.ZipFile(modlib_path, mode=‘a’)\r\n+ ~\r\nMissing argument in parameter list.\r\nAt line:31 char:33\r\n+ zinfo = zipfile.ZipInfo()\r\n+ ~\r\nAn expression was expected after ‘(’.\r\nAt line:34 char:25\r\n+ z.writestr(zinfo, sitecustomize)\r\n+ ~\r\nMissing argument in parameter list.\r\nNot all parse errors were reported. Correct the reported errors and try again.\r\n”\r\nAt line:6 char:1\r\n+ $exec_wrapper = [ScriptBlock]::Create($split_parts[0])\r\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n + CategoryInfo : NotSpecified: (:slight_smile: , MethodInvocationException\r\n + FullyQualifiedErrorId : ParseException\r\n \r\nThe expression after ‘&’ in a pipeline element produced an object that was not \r\nvalid. It must result in a command name, a script block, or a CommandInfo \r\nobject.\r\nAt line:7 char:2\r\n+ &$exec_wrapper\r\n+ ~~~~~~~~~~~~~\r\n + CategoryInfo : InvalidOperation: (:slight_smile: , RuntimeException\r\n + FullyQualifiedErrorId : BadExpression\r\n ", “module_stdout”: “”, “msg”: “MODULE FAILURE\nSee stdout/stderr for the exact error”, “rc”: 1}

ENVIRONMENT- AWX version: ansible 2.9.13

  • AWX install method: I have installed ansible on Linux.
  • Ansible version: ansible 2.9.13
  • Operating System: Linux
  • Web Browser: Google Chrome

'Praveen Kumar Singh' via AWX Project (awx-project@googlegroups.com) said:

ISSUE TYPE
   
   - Feature Idea

You're in the wrong place, you want the ansible google group:
   https://groups.google.com/forum/#!forum/ansible-project

This group is for AWX, which isn't related to what you're doing.

Bill