Ansible create module connect MSSQL

Hello,

I create module in file /library/module.py with this content :

#!/usr/bin/python

-- coding: utf-8 --

from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.parsing.convert_bool import BOOLEANS

DOCUMENTATION = ‘’’

Worth running with -vvvvv to see if there is any more information to help you debug the problem.

Try this syntax as my guess is ansible is looking for a module called ‘module’ instead of your custome ‘mssql_query’ module

`

  • name: “Execut my module on MSSQL”
    mssql_query:
    login_host: my_database_name
    port: 1433
    login_user: sa_ofs
    login_password: my_password
    query: SELECT * FROM dbo.my_table
    db: my_database
    autocommit: true
    tds_version: 7.1
    as_dict: false
    delegate_to: my_database_name

`

Hope this helps,

Jon