On Thu, 6 Jun 2019 at 11:07, Ryad karkar <[email protected]> wrote:
>
> Hi all,
>
> I have install mssql-cli for execut command line on instance MSSQL but when i 
> use this task:
>
Have you try to use sqlcmd?
https://docs.microsoft.com/en-us/sql/ssms/scripting/sqlcmd-use-the-utility?view=sql-server-2017

We have following test in one of our roles:

    - name: Check if the SQL users can login to their databases
      shell: |
        set -eu
        sqlscript='SELECT * FROM DATABASECHANGELOG;'
        /opt/mssql-tools/bin/sqlcmd \
          -S {{ sqlserver | quote }} \
          -U {{ sqluser | quote }} \
          -P {{ sqlpass | quote }} \
          -d {{ database | quote }} \
          -Q "${sqlscript}"
      loop: '{{ test_databases }}'
      vars:
        sqlserver: '{{ init_mssql_db_sql_server }}'
        sqluser: '{{ item.username | default(item.database) }}'
        sqlpass: '{{ item.password }}'
        database: '{{ item.database }}'


Wawrzek

-- 
Dr  Wawrzyniec NiewodniczaƄski    or Wawrzek for short
  PhD in Quantum Chemistry  & MSc in Molecular Engineering
   WWW: http://wawrzek.name E-MAIL: [email protected]
      Linux User #177124

-- 
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAC7-vpAuSWVtKK-F%2BhKVGXxAzWYFdsUh1Qn%3DoB-9OWUTdu0zoA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to