New in version 2.2.
Add or remove MSSQL databases from a remote host.
parameter | required | default | choices | comments |
---|---|---|---|---|
autocommit | no |
| Automatically commit the change only if the import succeed. Sometimes it is necessary to use autocommit=true, since some content can't be changed within a transaction. |
|
login_host | no | Host running the database |
||
login_password | no | The password used to authenticate with |
||
login_port | no | 1433 | Port of the MSSQL server. Requires login_host be defined as other then localhost if login_port is used |
|
login_user | no | The username used to authenticate with |
||
name | yes |
name of the database to add or remove aliases: db
|
||
state | no | present |
| The database state |
target | no | Location, on the remote host, of the dump file to read from or write to. Uncompressed SQL files ( .sql ) files are supported. |
# Create a new database with name 'jackdata' - mssql_db: name=jackdata state=present # Copy database dump file to remote host and restore it to database 'my_db' - copy: src=dump.sql dest=/tmp - mssql_db: name=my_db state=import target=/tmp/dump.sql
Note
Requires the pymssql Python package on the remote host. For Ubuntu, this is as easy as pip install pymssql (See pip.)
For more information on what this means please read Extras Modules
For help in developing on modules, should you be so inclined, please read Community Information & Contributing, developing_test_pr and Developing Modules.
© 2012–2016 Michael DeHaan
© 2016 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/mssql_db_module.html