SQL Install using ansible RRS feed

  • Question

  • Anyone got experience with installing SQL using ansible? I have the following bits in my main.yml file but when try to execute it fails.

    <style type="text/css">@page { margin: 2cm } p { margin-bottom: 0.25cm; line-height: 120% } </style>

    # Run installer from mounted ISO

    - name: Ensure an ISO is mounted


    image_path: C:\memset\SW_DVD9_NTRL_SQL_Svr_Standard_Edtn_2017_64Bit_English_OEM_VL_X21-56945.ISO

    state: present

    register: disk_image_out

    - debug:

    msg: "{{ disk_image_out }}"

    - name: Run setup from mounted iso


    path: '{{ disk_image_out.mount_paths[0] }}\setup.exe'

    product_id: 'xxxxx-xxxxx-xxxxx-xxxxx-xxxxx'

    state: present


    - '/ACTION=Install "/ConfigurationFile=C:\memset\SQL_2017_Standard_ConfigurationFile.ini"'

    - 'sa_password: "{{ sa_password }}"'

    - name: Add or update registry for ip port


    path: HKLM:\Software\Microsoft\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQLServer\SuperSocketNetLib\Tcp\IPAll

    name: TcpPort

    data: 1433

    type: string

    - name: start a service


    name: 'MSSQLSERVER'

    start_mode: auto

    force_dependent_services: yes

    state: started

    Run failure:

    TASK [install-mssql-2017 : Run setup from mounted iso] *****************************************************************************************************************************************
    changed: [xxxxxxx]

    TASK [install-mssql-2017 : Add or update registry for ip port] *********************************************************************************************************************************
    ok: [xxxxxxx]

    TASK [install-mssql-2017 : start a service] ****************************************************************************************************************************************************
    fatal: [xxxxxxx]: FAILED! => {"changed": false, "exists": false, "msg": "Service 'MSSQLSERVER' is not installed, need to set 'path' to create a new service"}
    to retry, use: --limit @/opt/ansible/cache/retry.d/sah_test_install-mssql-2017.retry

    PLAY RECAP *************************************************************************************************************************************************************************************
    xxxxxxx                  : ok=12   changed=7    unreachable=0    failed=1   

    Any ideas why it is failing?



    Friday, November 15, 2019 2:49 PM

All replies

  • If you have an issue with Ansible installer software, then better ask in an Ansible forum.

    Olaf Helper

    [ Blog] [ Xing] [ MVP]

    Friday, November 15, 2019 3:47 PM
  • Hi S.Ahilan,


    Your issue is more related to Ansible installer software. Would you please open a thread on the  Ansible forum. People there will help you well.


    Best regards,

    Dedmon Dai

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact

    Monday, November 18, 2019 2:16 AM