How to Manage sql server ( running on windows server) via ansible (running on unix platform)?

  ansible, unix, windows

I would like to know about How to Manage sql server (WINDOWS) (basically running some sql scripts) from an ansible instance running on a Unix platform. here is what I have done

contents of list.yml

---
- hosts: all

  tasks:
  - name: connect to the db server
    shell: "invoke-sqlcmd -username "username" -password "password" -Query "SELECT 1""
[dbserver]
DBSERVER:1515 ansible_user=ansible

contents of ansible.cfg

[defaults]
inventory = ./development.txt
ERROR:

ansible-playbook playbooks/list.yml

PLAY [all] **************************************************************************************************

TASK [Gathering Facts] **************************************************************************************
fatal: [DBSERVER]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: ssh: connect to host DBSERVER port 1515: Operation timed out", "unreachable": true}

PLAY RECAP **************************************************************************************************
DBSERVER          : ok=0    changed=0    unreachable=1    failed=0    skipped=0    rescued=0    ignored=0

Source: Windows Questions

LEAVE A COMMENT