# Ansible create module mssql\_querry

**URL:** <https://forum.ansible.com/t/ansible-create-module-mssql-querry/31982>\
**Category:** Ansible Project\
**Created:** [January 15, 2020, 2:39pm UTC](https://forum.ansible.com/t/ansible-create-module-mssql-querry/31982 "2020-01-15T14:39:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karther](https://avatars.discourse-cdn.com/v4/letter/k/3ec8ea/32.png) [@Karther](https://forum.ansible.com/u/Karther)\
**Post date:** [January 15, 2020, 2:39pm UTC](https://forum.ansible.com/t/ansible-create-module-mssql-querry/31982/1 "2020-01-15T14:39:33Z")

</div>

Hello,

I have create module mssql\_query in my repertory library/mssql\_query.py for execut commande ligne on my database MSSQL  
with this website : [https://github.com/melmorabity/ansible-mssql-query/blob/master/mssql\_query.py](https://github.com/melmorabity/ansible-mssql-query/blob/master/mssql_query.py)

My task is :

- local\_action:  
module: mssql\_query  
login\_host: my\_name\_host  
login\_user: my\_user  
port: 1433  
login\_password: my\_password  
query: SELECT \* FROM dbo.my\_table  
db: my\_database  
autocommit: true  
tds\_version: 7.1  
as\_dict: false

delegate\_to: localhost (or delegate\_to: mydatabase)

but the error is :

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: TypeError: connect() got an unexpected keyword argument ‘port’  
fatal: [my\_name\_host → localhost]: FAILED! =\> {“changed”: false, “module\_stderr”: “Traceback (most recent call last):\n File "", line 113, in \n File "", line 105, in \_ansiballz\_main\n File "", line 48, in invoke\_module\n File "/tmp/ansible\_mssql\_query\_payload\_hXTFhK/ **main**.py", line 155, in \n File "/tmp/ansible\_mssql\_query\_payload\_hXTFhK/ **main**.py", line 143, in main\nTypeError: connect() got an unexpected keyword argument ‘port’\n”, “module\_stdout”: “”, “msg”: “MODULE FAILURE\nSee stdout/stderr for the exact error”, “rc”: 1}

Someone have any idea please ??!! 🙂  
I need a expert ansible for my problem please !!

Best Regards,

Karther
