:service- Configures the ports that SQL be listening on and starts and enables the SQL Service.
version- SQL Version of the instance to be configured. Valid options are2012,2016,2017,2019,2022. Default is2012tcp_enabled- If TCP is enabled for the instance. Default is truesql_port- Port SQL will listen on. Default is 1433tcp_dynamic_ports- Sets the Dynamic port SQL will listen on. Default is an empty stringnp_enabled- Whether named pipes is enabled. Default is falsesm_enabled- Whether shared memory is enabled for the instancevia_default_port- Configures the Virtual Interface Adapter default port. Default is0:1433via_enabled- Whether Virtual Interface Adapter is enabled. Default is falsevia_listen_info- Configures the Virtual interface listening information. Default is0:1433agent_startup- Configures the SQL Agent Service startup type. Valid options areAutomatic,Manual,Disabled, orAutomatic (Delayed Start). Default isDisabled
Configure a SQL 2012 Express install with all the defaults
sql_server_configure 'SQLEXPRESS'Configure a SQL 2016 Express install
sql_server_configure 'SQLEXPRESS' do
version '2016'
endConfigure a SQL 2019 Express install
sql_server_configure 'SQLEXPRESS' do
version '2019'
endConfigure a SQL 2012 Evaluation install with a different port
sql_server_configure 'MSSQLSERVER' do
version '2012'
sql_port '1434'
end