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
win_disk_image:
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
win_package:
path: '{{ disk_image_out.mount_paths[0] }}\setup.exe'
product_id: 'xxxxx-xxxxx-xxxxx-xxxxx-xxxxx'
state: present
arguments:
- '/ACTION=Install "/ConfigurationFile=C:\memset\SQL_2017_Standard_ConfigurationFile.ini"'
- 'sa_password: "{{ sa_password }}"'
- name: Add or update registry for ip port
win_regedit:
path: HKLM:\Software\Microsoft\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQLServer\SuperSocketNetLib\Tcp\IPAll
name: TcpPort
data: 1433
type: string
- name: start a service
win_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?
Thanks,
Ahilan