You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+67-32
Original file line number
Diff line number
Diff line change
@@ -15,19 +15,19 @@
15
15
16
16
##Overview
17
17
18
-
The sqlserver module installs and manages Microsoft SQL Server 2012 and 2014 on Windows systems.
18
+
The sqlserver module installs and manages Microsoft SQL Server 2012 and 2014 on Windows systems.
19
19
20
20
##Module Description
21
-
22
-
The sqlserver module adds defined types to install and manage Microsoft SQL Server 2012 and 2014 on Windows Server 2012. The module can install SQL Server clients, multiple instances, and SQL features, as well as create and manage new databases and logins.
21
+
22
+
The sqlserver module adds defined types to install and manage Microsoft SQL Server 2012 and 2014 on Windows Server 2012. The module can install SQL Server clients, multiple instances, and SQL features, as well as create and manage new databases and logins.
23
23
24
24
##Setup
25
25
26
26
###What sqlserver affects
27
27
28
28
This module requires .NET 3.5 and installs it if it's not already on your system. This might require an internet connection.
29
29
30
-
###Setup Requirements
30
+
###Setup Requirements
31
31
32
32
The sqlserver module requires the following:
33
33
@@ -36,10 +36,10 @@ The sqlserver module requires the following:
36
36
* .NET 3.5
37
37
* ISO, mounted or expanded either locally or on a network share
38
38
* Windows Server 2012 or 2012R2
39
-
39
+
40
40
###Beginning with sqlserver
41
41
42
-
To get started with the sqlserver module, include these settings in your manifest:
42
+
To get started with the sqlserver module, include these settings in your manifest:
To use `sqlserver_tsql` as a trigger to other defined types in order to trigger other workflows
101
+
```
102
+
sqlserver_tsql{ 'Query Logging DB Status':
103
+
instance => 'MSSQLSERVER',
104
+
onlyif => "IF (SELECT count(*) FROM myDb.dbo.logging_table WHERE
105
+
message like 'FATAL%') > 1000 THROW 50000, 'Fatal Exceptions in Logging', 10",
106
+
notify => Exec['To Many Fatal Errors']
107
+
}
108
+
```
109
+
110
+
It can also be used to help clean up regular logs with conditional checks
111
+
```
112
+
sqlserver_tsql{ 'Cleanup Old Logs':
113
+
instance => 'MSSQLSERVER',
114
+
command => "DELETE FROM myDb.dbo.logging_table WHERE log_date < '${log_max_date}'",
115
+
onlyif => "IF exists(SELECT * FROM myDb.dbo.logging_table WHERE log_date < '${log_max_date}')
116
+
THROW 50000, 'need log cleanup', 10",
117
+
}
118
+
```
119
+
120
+
In the event you want something to always execute you can also leave the `onlyif` parameter out and have it execute every time
121
+
```
122
+
sqlserver_tsql{ 'Always running':
123
+
instance => 'MSSQLSERVER',
124
+
command => 'EXEC notified_executor()',
125
+
}
126
+
```
127
+
98
128
#### Windows SQL Server Terms
99
129
100
130
Terminology differs somewhat between various database systems; please refer to this list of terms for clarification.
@@ -114,10 +144,10 @@ Terminology differs somewhat between various database systems; please refer to t
114
144
*`ensure`: Ensures that the resource is present. Valid values are 'present', 'absent'.
115
145
*`features`: Specifies features to install or uninstall. The list of top-level features include IS, MDS, and Tools. The Tools feature will install Management Tools, SQL Server Data Tools, and other shared components. Valid values are 'Tools', 'BC', 'Conn', 'SSMS', 'ADV_SSMS', 'SDK', 'IS', 'MDS'.
116
146
*`is_svc_account`: Either domain user name or system account. Defaults to 'NT AUTHORITY\NETWORK SERVICE'.
117
-
*`is_svc_password`: Password for domain user.
147
+
*`is_svc_password`: Password for domain user.
118
148
*`pid`: Specify the SQL Server product key to configure which edition you would like to use. Can be left empty for evaluation versions.
119
149
*`provider`: The specific backend to use for this `sqlserver_features` resource. You seldom need to specify this---Puppet will usually discover the appropriate provider for your platform. Available providers are: `mssql`, `source`.
120
-
150
+
121
151
#### sqlserver_instance
122
152
123
153
*`agt_svc_account`: Either domain user name or system account.
@@ -139,22 +169,27 @@ Terminology differs somewhat between various database systems; please refer to t
139
169
*`sql_svc_password`: The SQL Server service password; required only for a domain account.
140
170
*`sql_sysadmin_accounts`: The Windows or SQL account(s) to provision as SQL Server system administrators.
141
171
172
+
####sqlserver_tsql
173
+
*`command`: TSQL to execute on a potentially conditional basis
174
+
*`onlyif`: TSQL to execute as a check to see if we should proceed and run the command parameter, should encounter a throw or error to trigger
175
+
*`instance`: SQL Server instance that we should execute against
176
+
142
177
### Defined Types
143
178
144
179
#### `sqlserver::config`
145
180
146
-
Stores the config file that allows Puppet to access and modify the instance.
181
+
Stores the config file that allows Puppet to access and modify the instance.
147
182
148
183
*`instance_name`: The instance name you want to manage. Defaults to the name of the define.
149
-
*`admin_user`: The SQL login with sysadmin rights on the server, can only be login of SQL_Login type.
184
+
*`admin_user`: The SQL login with sysadmin rights on the server, can only be login of SQL_Login type.
150
185
*`admin_pass`: The password to access the server to be managed.
151
186
152
187
```
153
188
sqlserver::config{'MSSQLSERVER':
154
189
admin_user => 'sa',
155
190
admin_pass => 'PuppetP@ssword1',
156
191
}
157
-
```
192
+
```
158
193
159
194
#### `sqlserver::database`
160
195
@@ -165,23 +200,23 @@ Creates, destroys, or updates databases, but does not move or modify files. Requ
165
200
*`ensure`: Ensures that the resource is present. Valid values are 'present', 'absent'. Defaults to 'present'.
166
201
*`compatibility`: Numeric representation of the SQL Server version with which the database should be compatible. For example, 100 = SQL Server 2008 through SQL Server 2012. For a complete list of values, refer to [http://msdn.microsoft.com/en-us/library/bb510680.aspx](http://msdn.microsoft.com/en-us/library/bb510680.aspx).
167
202
*`collation_name`: Modifies dictionary default sort rules for the datatbase. Defaults to 'Latin1_General'. To find out what other values your system supports, run the query `SELECT * FROM sys.fn_helpcollations() WHERE name LIKE 'SQL%'`.
168
-
*`filestream_non_transacted_access`: Specifies the level of non-transactional FILESTREAM access to the database. This parameter is affected only at creation; updates will not change this setting. Valid values are 'OFF', 'READ_ONLY', 'FULL'. Requires defined type `sqlserver::sp_configure`.
169
-
*`filestream_directory_name`: Accepts a Windows-compatible directory name. This name should be unique among all the Database_Directory names in the SQL Server instance. Uniqueness comparison is case-insensitive, regardless of SQL Server collation settings. This option should be set before creating a FileTable in this database. This parameter is affected only at creation; updates will not change this setting. Requires defined type `sqlserver::sp_configure`.
170
-
*`filespec_name`: Specifies the logical name for the file. NAME is required when FILENAME is specified, except when specifying one of the FOR ATTACH clauses. A FILESTREAM filegroup cannot be named PRIMARY. This parameter is affected only at creation; updates will not change this setting.
171
-
*`filespec_filename`: Specifies the operating system (physical) file name. This parameter is affected only at creation; updates will not change this setting.
172
-
*`filespec_size`: Specifies the size of the file. The kilobyte (KB), megabyte (MB), gigabyte (GB), or terabyte (TB) suffixes can be used. The default is MB. Values can not be greater than 2147483647. This parameter is affected only at creation; updates will not change this setting.
173
-
*`filespec maxsize`: Specifies the maximum size to which the file can grow. MAXSIZE cannot be specified when the os_file_name is specified as a UNC path. This parameter is affected only at creation; updates will not change this setting.
174
-
*`filespec_filegrowth`: Specifies the automatic growth increment of the file. The FILEGROWTH setting for a file cannot exceed the MAXSIZE setting. FILEGROWTH cannot be specified when the os_file_name is specified as a UNC path. FILEGROWTH does not apply to a FILESTREAM filegroup. This parameter is affected only at creation; updates will not change this setting.
175
-
*`log_name`: Specifies the logical name for the file. NAME is required when FILENAME is specified, except when specifying one of the FOR ATTACH clauses. A FILESTREAM filegroup cannot be named PRIMARY. This parameter is affected only at creation; updates will not change this setting.
176
-
*`log_filename`: Specifies the operating system (physical) file name. This parameter is affected only at creation; updates will not change this setting.
177
-
*`log_size`: Specifies the size of the file. The kilobyte (KB), megabyte (MB), gigabyte (GB), or terabyte (TB) suffixes can be used. The default is MB. Values can not be greater than 2147483647. This parameter is affected only at creation; updates will not change this setting.
178
-
*`log_maxsize`: Specifies the maximum size to which the file can grow. MAXSIZE cannot be specified when the os_file_name is specified as a UNC path. This parameter is affected only at creation; updates will not change this setting.
179
-
*`log_filegrowth`: Specifies the automatic growth increment of the file. The FILEGROWTH setting for a file cannot exceed the MAXSIZE setting. FILEGROWTH cannot be specified when the os_file_name is specified as a UNC path. FILEGROWTH does not apply to a FILESTREAM filegroup. This parameter is affected only at creation; updates will not change this setting.
203
+
*`filestream_non_transacted_access`: Specifies the level of non-transactional FILESTREAM access to the database. This parameter is affected only at creation; updates will not change this setting. Valid values are 'OFF', 'READ_ONLY', 'FULL'. Requires defined type `sqlserver::sp_configure`.
204
+
*`filestream_directory_name`: Accepts a Windows-compatible directory name. This name should be unique among all the Database_Directory names in the SQL Server instance. Uniqueness comparison is case-insensitive, regardless of SQL Server collation settings. This option should be set before creating a FileTable in this database. This parameter is affected only at creation; updates will not change this setting. Requires defined type `sqlserver::sp_configure`.
205
+
*`filespec_name`: Specifies the logical name for the file. NAME is required when FILENAME is specified, except when specifying one of the FOR ATTACH clauses. A FILESTREAM filegroup cannot be named PRIMARY. This parameter is affected only at creation; updates will not change this setting.
206
+
*`filespec_filename`: Specifies the operating system (physical) file name. This parameter is affected only at creation; updates will not change this setting.
207
+
*`filespec_size`: Specifies the size of the file. The kilobyte (KB), megabyte (MB), gigabyte (GB), or terabyte (TB) suffixes can be used. The default is MB. Values can not be greater than 2147483647. This parameter is affected only at creation; updates will not change this setting.
208
+
*`filespec maxsize`: Specifies the maximum size to which the file can grow. MAXSIZE cannot be specified when the os_file_name is specified as a UNC path. This parameter is affected only at creation; updates will not change this setting.
209
+
*`filespec_filegrowth`: Specifies the automatic growth increment of the file. The FILEGROWTH setting for a file cannot exceed the MAXSIZE setting. FILEGROWTH cannot be specified when the os_file_name is specified as a UNC path. FILEGROWTH does not apply to a FILESTREAM filegroup. This parameter is affected only at creation; updates will not change this setting.
210
+
*`log_name`: Specifies the logical name for the file. NAME is required when FILENAME is specified, except when specifying one of the FOR ATTACH clauses. A FILESTREAM filegroup cannot be named PRIMARY. This parameter is affected only at creation; updates will not change this setting.
211
+
*`log_filename`: Specifies the operating system (physical) file name. This parameter is affected only at creation; updates will not change this setting.
212
+
*`log_size`: Specifies the size of the file. The kilobyte (KB), megabyte (MB), gigabyte (GB), or terabyte (TB) suffixes can be used. The default is MB. Values can not be greater than 2147483647. This parameter is affected only at creation; updates will not change this setting.
213
+
*`log_maxsize`: Specifies the maximum size to which the file can grow. MAXSIZE cannot be specified when the os_file_name is specified as a UNC path. This parameter is affected only at creation; updates will not change this setting.
214
+
*`log_filegrowth`: Specifies the automatic growth increment of the file. The FILEGROWTH setting for a file cannot exceed the MAXSIZE setting. FILEGROWTH cannot be specified when the os_file_name is specified as a UNC path. FILEGROWTH does not apply to a FILESTREAM filegroup. This parameter is affected only at creation; updates will not change this setting.
180
215
*`containment`: Defaults to 'NONE'.Other possible values are 'PARTIAL'. Setting `containment` =>'PARTIAL' requires defined type `sqlserver::sp_configure`. See [http://msdn.microsoft.com/en-us/library/ff929071.aspx](http://msdn.microsoft.com/en-us/library/ff929071.aspx) for complete documentation about containment.
181
216
*`default_fulltext_language`: Sets default fulltext language. Only applicable if `containment` => ‘PARTIAL’. Valid values are documented at [http://msdn.microsoft.com/en-us/library/ms190303.aspx](http://msdn.microsoft.com/en-us/library/ms190303.aspx). Defaults to 'us_english'.
182
217
*`default_language`: Sets default language. Only applicable if `containment` => ‘PARTIAL’. Valid values are documented at http://msdn.microsoft.com/en-us/library/ms190303.aspx. Defaults to 'us_english'.
183
218
*`nested_triggers`: Enables cascading triggers. Only applicable if `containment` => ‘PARTIAL’. Valid values are 'ON', 'OFF'. See [http://msdn.microsoft.com/en-us/library/ms178101.aspx](http://msdn.microsoft.com/en-us/library/ms178101.aspx) for complete documentation.
184
-
*`transform_noise_words`: Removes noise or stop words, such as “is”, “the”, “this”. Only applicable if `containment` => ‘PARTIAL’. Valid values are 'ON', 'OFF'.
219
+
*`transform_noise_words`: Removes noise or stop words, such as “is”, “the”, “this”. Only applicable if `containment` => ‘PARTIAL’. Valid values are 'ON', 'OFF'.
185
220
*`two_digit_year_cutoff`: The year at which the system will treat the year as four digits instead of two. For example, if set to '1999', 1998 would be abbreviated to '98', while 2014 would be '2014'. Only applicable if `containment` => ‘PARTIAL’. Valid values are any year between 1753 and 9999. Defaults to 2049.
186
221
*`db_chaining`: Whether the database can be the source or target of a cross-database ownership chain. Only applicable if `containment` => ‘PARTIAL’. Valid values are 'ON', 'OFF'. Defaults to 'OFF'.
187
222
*`trustworthy`: Whether database modules (such as views, user-defined functions, or stored procedures) that use an impersonation context can access resources outside the database. Only applicable if `containment` => ‘PARTIAL’. Valid values are 'ON', 'OFF'. Defaults to 'OFF'.
@@ -208,13 +243,13 @@ Requires defined type `sqlserver::config`.
208
243
*`default_database`: Sets the database the login should default to when connecting. Defaults to 'master'.
209
244
*`default_language`: Sets default language. Valid values are documented at http://msdn.microsoft.com/en-us/library/ms190303.aspx. Defaults to 'us_english'.
210
245
*`check_expiration`: For SQL logins, checks to see if password has expired and user should be forced to change the password. Only applicable when Login_Type = 'SQL_LOGIN'. Valid values are 'true', 'false'. Default value is 'false'.
211
-
*`check_policy`: Checks the password policy. Only applicable when Login_Type = 'SQL_LOGIN'. Valid values are 'true', 'false'. Defaults to 'true'.
212
-
*`disabled`: Valid values are 'true', 'false'. Defaults to 'false'.
246
+
*`check_policy`: Checks the password policy. Only applicable when Login_Type = 'SQL_LOGIN'. Valid values are 'true', 'false'. Defaults to 'true'.
247
+
*`disabled`: Valid values are 'true', 'false'. Defaults to 'false'.
213
248
214
249
**For more information about these settings and configuration in Microsoft SQL Server, please see:**
215
250
216
251
*[Server Role Members](http://msdn.microsoft.com/en-us/library/ms186320.aspx)
This module is available only for Puppet Enterprise 3.7 and later.
273
+
This module is available only for Puppet Enterprise 3.7 and later.
239
274
240
275
## Development
241
276
242
-
This is a proprietary module only available to Puppet Enterprise users. As such, we have no formal way for users to contribute toward development. However, we know our users are a charming collection of brilliant people, so if you have a bug you've fixed or a contribution to this module, please generate a diff and throw it into a ticket to support---they'll ensure that we get it.
277
+
This is a proprietary module only available to Puppet Enterprise users. As such, we have no formal way for users to contribute toward development. However, we know our users are a charming collection of brilliant people, so if you have a bug you've fixed or a contribution to this module, please generate a diff and throw it into a ticket to support---they'll ensure that we get it.
0 commit comments