Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
bennojoy committed Aug 26, 2017
0 parents commit b80c168
Show file tree
Hide file tree
Showing 3 changed files with 140 additions and 0 deletions.
46 changes: 46 additions & 0 deletions files/sql_conf.ini.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#jinja2: newline_sequence:"\r\n"
;SQL Server 2014 Configuration File
[OPTIONS]
IACCEPTSQLSERVERLICENSETERMS="True"
ACTION="Install"
ENU="True"
QUIET="True"
QUIETSIMPLE="False"
UpdateEnabled="False"
ERRORREPORTING="False"
USEMICROSOFTUPDATE="False"
FEATURES=SQLENGINE,FULLTEXT,DQ,RS,SSMS,ADV_SSMS
UpdateSource="MU"
HELP="False"
INDICATEPROGRESS="False"
X86="False"
INSTALLSHAREDDIR="C:\Program Files\Microsoft SQL Server"
INSTALLSHAREDWOWDIR="C:\Program Files (x86)\Microsoft SQL Server"
INSTANCENAME="{{ sql_instance_name }}"
SQMREPORTING="False"
INSTANCEID="{{ sql_instance_name }}"
RSINSTALLMODE="DefaultNativeMode"
INSTANCEDIR="C:\Program Files\Microsoft SQL Server"
AGTSVCACCOUNT="NT AUTHORITY\NETWORK SERVICE"
AGTSVCPASSWORD="P@ssw0rd"
AGTSVCSTARTUPTYPE="Automatic"
COMMFABRICPORT="0"
COMMFABRICNETWORKLEVEL="0"
COMMFABRICENCRYPTION="0"
MATRIXCMBRICKCOMMPORT="0"
SQLSVCSTARTUPTYPE="Automatic"
FILESTREAMLEVEL="0"
ENABLERANU="False"
SQLCOLLATION="SQL_Latin1_General_CP1_CI_AS"
SQLSVCACCOUNT="{{ ansible_hostname }}\vagrant"
SQLSVCPASSWORD="vagrant"
SQLSYSADMINACCOUNTS="BUILTIN\Administrators"
ADDCURRENTUSERASSQLADMIN="True"
TCPENABLED="1"
NPENABLED="0"
BROWSERSVCSTARTUPTYPE="Disabled"
RSSVCACCOUNT=""
RSSVCPASSWORD="P@ssw0rd"
RSSVCSTARTUPTYPE="manual"
IACCEPTSQLSERVERLICENSETERMS="True"
FTSVCACCOUNT="NT Service\MSSQLFDLauncher"
46 changes: 46 additions & 0 deletions files/sql_conf.ini.j2_working
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#jinja2: newline_sequence:"\r\n"
;SQL Server 2014 Configuration File
[OPTIONS]
IACCEPTSQLSERVERLICENSETERMS="True"
ACTION="Install"
ENU="True"
QUIET="True"
QUIETSIMPLE="False"
UpdateEnabled="False"
ERRORREPORTING="False"
USEMICROSOFTUPDATE="False"
FEATURES=SQLENGINE,FULLTEXT,DQ,RS,SSMS,ADV_SSMS
UpdateSource="MU"
HELP="False"
INDICATEPROGRESS="False"
X86="False"
INSTALLSHAREDDIR="C:\Program Files\Microsoft SQL Server"
INSTALLSHAREDWOWDIR="C:\Program Files (x86)\Microsoft SQL Server"
INSTANCENAME="{{ sql_instance_name }}"
SQMREPORTING="False"
INSTANCEID="{{ sql_instance_name }}"
RSINSTALLMODE="DefaultNativeMode"
INSTANCEDIR="C:\Program Files\Microsoft SQL Server"
AGTSVCACCOUNT="NT AUTHORITY\NETWORK SERVICE"
AGTSVCPASSWORD="P@ssw0rd"
AGTSVCSTARTUPTYPE="Automatic"
COMMFABRICPORT="0"
COMMFABRICNETWORKLEVEL="0"
COMMFABRICENCRYPTION="0"
MATRIXCMBRICKCOMMPORT="0"
SQLSVCSTARTUPTYPE="Automatic"
FILESTREAMLEVEL="0"
ENABLERANU="False"
SQLCOLLATION="SQL_Latin1_General_CP1_CI_AS"
SQLSVCACCOUNT="NT Service\MSSQL$SQLEXPRESS"
SQLSVCPASSWORD="P@ssw0rd"
SQLSYSADMINACCOUNTS=“BUILTIN\Administrators"
ADDCURRENTUSERASSQLADMIN="True"
TCPENABLED="1"
NPENABLED="0"
BROWSERSVCSTARTUPTYPE="Disabled"
RSSVCACCOUNT=""
RSSVCPASSWORD="P@ssw0rd"
RSSVCSTARTUPTYPE="manual"
IACCEPTSQLSERVERLICENSETERMS="True"
FTSVCACCOUNT="NT Service\MSSQLFDLauncher"
48 changes: 48 additions & 0 deletions win_sql_install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
- hosts: all
gather_facts: True
vars:
sql_instance_name: benz
tasks:
- debug: var=hostvars[inventory_hostname]
- name: create a directory for installer download
win_file:
path: c:\sql
state: directory

- name: create a directory for installer extraction
win_file:
path: c:\sql\installer
state: directory

- name: create the configuration file
win_template:
src: files/sql_conf.ini.j2
dest: c:\sql\sql_conf.ini

- name: a pre requisite of sql net-framework-35
win_feature:
name: NET-Framework-Core
state: present

- name: check downloaded file exists
win_stat:
path: c:\sql\sql_installer.exe
register: installer_file

- name: get the installer
win_get_url:
url: 'http://download.microsoft.com/download/E/A/E/EAE6F7FC-767A-4038-A954-49B8B05D04EB/ExpressAndTools%2064BIT/SQLEXPRWT_x64_ENU.exe'
dest: 'c:\sql\sql_installer.exe'
when: not installer_file.stat.exists

- name: extract the installer
win_command: c:\sql\sql_installer.exe /q /x:c:\sql\installer
args:
chdir: c:\sql
creates: c:\sql\installer\setup.exe

- name: Install the database
win_command: c:\sql\installer\setup.exe /configurationfile=c:\sql\sql_conf.ini
args:
chdir: c:\sql

0 comments on commit b80c168

Please sign in to comment.