Note
This plugin is part of the community.general collection.
To install it use: ansible-galaxy collection install community.general.
To use it in a playbook, specify: community.general.odbc.
New in version 1.0.0: of community.general
The below requirements are needed on the host that executes this module.
| Parameter | Choices/Defaults | Comments |
|---|---|---|
| dsn string / required | The connection string passed into ODBC. | |
| params list / elements=string | Parameters to pass to the SQL query. | |
| query string / required | The SQL query to perform. |
Note
changed_when: [yes or no].- name: Set some values in the test db
community.general.odbc:
dsn: "DRIVER={ODBC Driver 13 for SQL Server};Server=db.ansible.com;Database=my_db;UID=admin;PWD=password;"
query: "Select * from table_a where column1 = ?"
params:
- "value1"
changed_when: no
Common return values are documented here, the following are the fields unique to this module:
| Key | Returned | Description |
|---|---|---|
| description list / elements=dictionary | success | List of dicts about the columns selected from the cursors, likely empty for DDL statements. See notes. |
| results list / elements=list | success | List of lists of strings containing selected rows, likely empty for DDL statements. |
| row_count string | success | The number of rows selected or modified according to the cursor defaults to -1. See notes. |
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.10/collections/community/general/odbc_module.html