Hello guy !! :)
I want create module for connection and execution script sql in my database
MSSQL.
I have create programme python :
*#!/usr/bin/python*
*import pymssql*
*conn = pymssql.connect(host="my_host_database", user="my_user",
password="my_password", database="my_database")*
*cur = conn.cursor()*
*try:*
* with open('script_sql.sql') as f:*
* cur.execute(f.read().decode('utf-8'))*
* conn.commit()*
*except:*
* print("Il y a une erreur lors de l'execution du script")*
*cur.close()*
This programe works perfectly, but i want create module ansible for this
programme python.
For exemple, my goal is that my module name *mssql_query*:
- name: "Execute my new module"
mssql_query:
name: *my_host_database*
user: *my_user*
password: *my_password*
database: *my_database*
file_sql: *./script_sql.sql*
Someone can you help me for transform my program python in module ansible
please ?
Thanks you very much !! :)
Best regards,
Karther
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/c3c8934a-0da1-48df-9ed5-665247432724%40googlegroups.com.