sqlserver::config: Define Resource Type: sqlserver::configsqlserver::database: Define Resource Type: sqlserver::databasesqlserver::login: Define Resource Type: sqlserver::loginsqlserver::login::permissions: Define Resource Type: sqlserver::login::permissions#sqlserver::role: Define Resource Type: sqlserver::role::permissionssqlserver::role::permissions: Define Resource Type: sqlserver::role::permissionssqlserver::sp_configure: Defined Resource Type: sqlserver::sp_configuresqlserver::user: Define Resource Type: sqlserver::usersqlserver::user::permissions: Define Resource Type: sqlserver::user::permissions
sqlserver_features: Due to our prefetch and unaware of what name the user will provide we munge the value to meet our expecations.sqlserver_instance: Namevarsqlserver_tsql: Namevar
sqlserver::partial_params_args: this function populates and returns the string of arguments which later gets injected in template.sqlserver_is_domain_or_local_usersqlserver_upcasesqlserver_validate_hash_uniq_valuessqlserver_validate_instance_namesqlserver_validate_rangesqlserver_validate_size
get_sql_logins: Retrieve information about the logins configured for a SQL Server instance.get_sqlagent_jobs: Return information about SQL Agent jobs and job steps.set_sql_logins: Set IsDisabled, and Password properties of a SQL Loginstart_sql_agent_job: Start SQL Agent jobs on a server. You can start at a specified job step number (zero based indexes), and you can either wait on the job to co
Define Resource Type: sqlserver::config
sqlserver::config{'MSSQLSERVER':
admin_user => 'sa',
admin_pass => 'PuppetP@ssword1',
}The following parameters are available in the sqlserver::config defined type:
Data type: String[1,16]
The instance name you want to manage. Defaults to the $title when not defined explicitly.
Default value: $title
Data type: Optional[Variant[Sensitive[String], String]]
Only required for SQL_LOGIN type. A user/login who has sysadmin rights on the server Can be passed as a sensitive value
Default value: undef
Data type: Optional[Variant[Sensitive[String], String]]
Only required for SQL_LOGIN type. The password in order to access the server to be managed. Can be passed as a sensitive value
Default value: undef
Data type: Enum['SQL_LOGIN', 'WINDOWS_LOGIN']
The type of account use to configure the server. Valid values are SQL_LOGIN and WINDOWS_LOGIN, with a default of SQL_LOGIN The SQL_LOGIN requires the admin_user and admin_pass to be set The WINDOWS_LOGIN requires the adm_user and admin_pass to be empty or undefined
Default value: 'SQL_LOGIN'
Requirement/Dependencies: Requires defined type {sqlserver::config} in order to execute against the SQL Server instance
- See also
- http://msdn.microsoft.com/en-us/library/ff929071.aspx
- Contained Databases
- http://msdn.microsoft.com/en-us/library/ms176061.aspx
- CREATE DATABASE TSQL
- http://msdn.microsoft.com/en-us/library/ms174269.aspx
- ALTER DATABASE TSQL
- http://msdn.microsoft.com/en-us/library/ms190303.aspx
- System Languages
- http://msdn.microsoft.com/en-us/library/ff929071.aspx
The following parameters are available in the sqlserver::database defined type:
db_nameinstanceensurecompatibilitycollation_namefilestream_non_transacted_accessfilestream_directory_namefilespec_namefilespec_filenamefilespec_sizefilespec_maxsizefilespec_filegrowthlog_namelog_filenamelog_sizelog_maxsizelog_filegrowthcontainmentdefault_fulltext_languagedefault_languagenested_triggerstransform_noise_wordstwo_digit_year_cutoffdb_chainingtrustworthy
Data type: String[1,128]
The database you would like to manage
Default value: $title
Data type: String[1,16]
The name of the instance which to connect to, instance names can not be longer than 16 characters
Default value: 'MSSQLSERVER'
Data type: Enum['present', 'absent']
Defaults to 'present', valid values are 'present' | 'absent'
Default value: 'present'
Data type: Integer
Numberic representation of what SQL Server version you want the database to be compatabible with.
Default value: 100
Data type: Optional[String[1]]
Default value: undef
Data type: Optional[Enum['OFF', 'READ_ONLY', 'FULL']]
Value should be { OFF | READ_ONLY | FULL } Specifies the level of non-transactional FILESTREAM access to the database.
Default value: undef
Data type: Optional[Pattern[/^[\w|\s]+$/]]
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.
Default value: undef
Data type: Optional[String[1,128]]
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.
Default value: undef
Data type: Optional[Stdlib::Absolutepath]
Specifies the operating system (physical) file name.
Default value: undef
Data type: Optional[String[1]]
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
Default value: undef
Data type: Optional[String[1]]
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
Default value: undef
Data type: Optional[String[1]]
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.
Default value: undef
Data type: Optional[String[1,128]]
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.
Default value: undef
Data type: Optional[Stdlib::Absolutepath]
Specifies the operating system (physical) file name.
Default value: undef
Data type: Optional[String[1]]
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
Default value: undef
Data type: Optional[String[1]]
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
Default value: undef
Data type: Optional[String[1]]
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.
Default value: undef
Data type: Enum['PARTIAL', 'NONE']
Defaults to 'NONE'. Other possible values are 'PARTIAL', see http://msdn.microsoft.com/en-us/library/ff929071.aspx
Default value: 'NONE'
Data type: String[1]
Language name i.e. us_english which are documented at http://msdn.microsoft.com/en-us/library/ms190303.aspx
Default value: 'English'
Data type: String[1]
Language name i.e. us_english which are documented at http://msdn.microsoft.com/en-us/library/ms190303.aspx
Default value: 'us_english'
Data type: Optional[Enum['ON', 'OFF']]
On | Off see http://msdn.microsoft.com/en-us/library/ms178101.aspx
Default value: undef
Data type: Optional[Enum['ON', 'OFF']]
ON | OFF
Default value: undef
Data type: Integer[1753, 9999]
Defaults to 2049 | <any year between 1753 and 9999>
Default value: 2049
Data type: Enum['ON', 'OFF']
ON | OFF When ON is specified, the database can be the source or target of a cross-database ownership chain. When OFF, the database cannot participate in cross-database ownership chaining. The default is OFF.
Default value: 'OFF'
Data type: Enum['ON', 'OFF']
When ON is specified, database modules that use an impersonation context can access resources outside the database. For example, views, user-defined functions, or stored procedures. When OFF, database modules in an impersonation context cannot access resources outside the database. The default is OFF.
Default value: 'OFF'
Requirement/Dependencies: Requires defined type {sqlserver::config} in order to execute against the SQL Server instance
- See also
- Puppet::Parser::Fucntions#sqlserver_validate_instance_name
- http://msdn.microsoft.com/en-us/library/ms186320(v=sql.110).aspx
- Server Role Members
- http://technet.microsoft.com/en-us/library/ms189751(v=sql.110).aspx
- Create Login
- http://technet.microsoft.com/en-us/library/ms189828(v=sql.110).aspx
- Alter Login
The following parameters are available in the sqlserver::login defined type:
logininstanceensurepasswordsvrroleslogin_typedefault_databasedefault_languagecheck_expirationcheck_policydisabledpermissions
Data type: String[1, 128]
The SQL or Windows login you would like to manage
Default value: $title
Data type: String[1,16]
The name of the instance which to connect to, instance names can not be longer than 16 characters
Default value: 'MSSQLSERVER'
Data type: Enum['present', 'absent']
Defaults to 'present', valid values are 'present' | 'absent'
Default value: 'present'
Data type: Optional[Variant[Sensitive[String], String]]
Plain text password. Only applicable when Login_Type = 'SQL_LOGIN'. Can be passed through as a sensitive value.
Default value: undef
Data type: Hash
A hash of preinstalled server roles that you want assigned to this login. sample usage would be { 'diskadmin' => 1, 'dbcreator' => 1, 'sysadmin' => 0, }
Default value: {}
Data type: Enum['SQL_LOGIN', 'WINDOWS_LOGIN']
Defaults to 'SQL_LOGIN', possible values are 'SQL_LOGIN' or 'WINDOWS_LOGIN'
Default value: 'SQL_LOGIN'
Data type: String
The database that when connecting the login should default to, the default value is 'master'
Default value: 'master'
Data type: String
The default language is 'us_english', a list of possible
Default value: 'us_english'
Data type: Boolean
Default value is false, possible values of true | false. Only applicable when Login_Type = 'SQL_LOGIN'.
Default value: false
Data type: Boolean
Default value is false, possible values are true | false. Only applicable when Login_Type = 'SQL_LOGIN'.
Default value: true
Data type: Boolean
Default value is false. Accepts [Boolean] values of true or false.
Default value: false
Data type: Hash
A hash of permissions that should be managed for the login. Valid keys are 'GRANT', 'GRANT_WITH_OPTION', 'DENY' or 'REVOKE'. Valid values must be an array of Strings i.e. {'GRANT' => ['CONNECT SQL', 'CREATE ANY DATABASE'] }
Default value: {}
Requirement/Dependencies: Requires defined type {sqlserver::config} in order to execute against the SQL Server instance
The following parameters are available in the sqlserver::login::permissions defined type:
Data type: String[1,128]
The login for which the permission will be manage.
Data type: Array[String[4,128]]
An array of permissions you would like managed. i.e. ['SELECT', 'INSERT', 'UPDATE', 'DELETE']
Data type: Pattern[/(?i)^(GRANT|REVOKE|DENY)$/]
The state you would like the permission in. Accepts 'GRANT', 'DENY', 'REVOKE'. Please note that REVOKE equates to absent and will default to database and system level permissions.
Default value: 'GRANT'
Data type: String[1,16]
The name of the instance where the user and database exists. Defaults to 'MSSQLSERVER'
Default value: 'MSSQLSERVER'
Data type: Boolean
Bolean value that allows user to grant options.
Default value: false
Requirement/Dependencies: Requires defined type {sqlserver::config} in order to execute against the SQL Server instance
The following parameters are available in the sqlserver::role defined type:
Data type: Enum['present', 'absent']
Whether the role should be absent or present
Default value: 'present'
Data type: String[1,128]
The name of the role for which the permissions will be manage.
Default value: $title
Data type: String[1,16]
The name of the instance where the role and database exists. Defaults to 'MSSQLSERVER'
Default value: 'MSSQLSERVER'
Data type: Optional[String]
The database principal that should own the role
Default value: undef
Data type: Enum['SERVER', 'DATABASE']
Whether the Role is SERVER or DATABASE
Default value: 'SERVER'
Data type: String[1,128]
The name of the database the role exists on when specifying type => 'DATABASE'. Defaults to 'master'
Default value: 'master'
Data type: Hash
A hash of permissions that should be managed for the role. Valid keys are 'GRANT', 'GRANT_WITH_OPTION', 'DENY' or 'REVOKE'. Valid values must be an array of Strings i.e. {'GRANT' => ['CONNECT', 'CREATE ANY DATABASE'] }
Default value: {}
Data type: Array[String]
An array of users/logins that should be a member of the role
Default value: []
Data type: Boolean
Whether we should purge any members not listed in the members parameter. Default: false
Default value: false
Requirement/Dependencies: Requires defined type {sqlserver::config} in order to execute against the SQL Server instance
The following parameters are available in the sqlserver::role::permissions defined type:
Data type: String[1,128]
The name of the role for which the permissions will be manage.
Data type: Array[String[4,128]]
An array of permissions you want manged for the given role
Data type: Pattern[/(?i)^(GRANT|REVOKE|DENY)$/]
The state you would like the permission in. Accepts 'GRANT', 'DENY', 'REVOKE'. Please note that REVOKE equates to absent and will default to database and system level permissions.
Default value: 'GRANT'
Data type: Boolean
Whether to give the role the option to grant this permission to other principal objects, accepts true or false, defaults to false
Default value: false
Data type: Enum['SERVER','DATABASE']
Whether the Role is SERVER or DATABASE
Default value: 'SERVER'
Data type: String[1,128]
The name of the database the role exists on when specifying type => 'DATABASE'. Defaults to 'master'
Default value: 'master'
Data type: String[1,16]
The name of the instance where the role and database exists. Defaults to 'MSSQLSERVER'
Default value: 'MSSQLSERVER'
Required Dependencies: Requires defined type {sqlserver::config} in order to execute against the SQL Server instance
@see http://msdn.microsoft.com/en-us/library/ms176069.aspx Reconfigure Explanation @see http://msdn.microsoft.com/en-us/library/ms189631.aspx Server Configuration Options
The following parameters are available in the sqlserver::sp_configure defined type:
Data type: Pattern['^\w+']
The config name found within sys.configurations that you would like to update
Default value: $title
Data type: Integer
The value you would like to change to for the given config_name, must be an integer value
Data type: String[1,16]
The name of the instance you would like to manage against
Default value: 'MSSQLSERVER'
Data type: Boolean
If you would like to run RECONFIGURE against the server after updating the value, defaults to true
Default value: true
Data type: Boolean
This pertains tot he reconfigure in which you would want to override or force the reconfigure, defaults to false
Default value: false
Data type: Boolean
Will ensure service resource and notify if changes occur for a restart
Default value: false
Requirement/Dependencies: Requires defined type {sqlserver::config} in order to execute against the SQL Server instance
sqlserver::user{'myUser':
database => 'loggingDatabase',
login => 'myUser',
}The following parameters are available in the sqlserver::user defined type:
Data type: String[1]
The username you want to manage, defaults to the title
Default value: $title
Data type: String[1,128]
The database you want the user to be created as
Data type: Enum['present', 'absent']
Ensure present or absent
Default value: 'present'
Data type: Optional[String]
SQL schema you would like to default to, typically 'dbo'
Default value: undef
Data type: String[1,16]
The named instance you want to manage against
Default value: 'MSSQLSERVER'
Data type: Optional[String[1]]
The login to associate the user with, by default SQL Server will assume user and login match if left empty
Default value: undef
Data type: Optional[String[1,128]]
The password for the user, can only be used when the database is a contained database.
Default value: undef
Data type: Hash
A hash of permissions that should be managed for the user. Valid keys are 'GRANT', 'GRANT_WITH_OPTION', 'DENY' or 'REVOKE'. Valid values must be an array of Strings i.e. {'GRANT' => ['SELECT', 'INSERT'] }
Default value: {}
Requirement/Dependencies: Requires defined type {sqlserver::config} in order to execute against the SQL Server instance
The following parameters are available in the sqlserver::user::permissions defined type:
Data type: String[1,128]
The username for which the permission will be manage.
Data type: String[1,128]
The databaser you would like the permission managed on.
Default value: 'master'
Data type: Array[String[4,128]]
An array of permissions you would like managed. i.e. ['SELECT', 'INSERT', 'UPDATE', 'DELETE']
Data type: Pattern[/(?i)^(GRANT|REVOKE|DENY)$/]
The state you would like the permission in. Accepts 'GRANT', 'DENY', 'REVOKE'. Please note that REVOKE equates to absent and will default to database and system level permissions.
Default value: 'GRANT'
Data type: Boolean
Whether to give the user the option to grant this permission to other users, accepts true or false, defaults to false
Default value: false
Data type: String[1,16]
The name of the instance where the user and database exists. Defaults to 'MSSQLSERVER'
Default value: 'MSSQLSERVER'
Due to our prefetch and unaware of what name the user will provide we munge the value to meet our expecations.
The following properties are available in the sqlserver_features type.
Valid values: present, absent
The basic property that the resource should be in.
Default value: present
Valid values: Tools, BC, Conn, SSMS, ADV_SSMS, SDK, IS, MDS, BOL, DREPLAY_CTLR, DREPLAY_CLT, DQC
Specifies features to install, uninstall, or upgrade. The list of top-level features include BC, Conn, SSMS, ADV_SSMS, SDK, IS and MDS. The 'Tools' feature is deprecated. Instead specify 'BC', 'SSMS', 'ADV_SSMS', 'Conn', and 'SDK' explicitly.
The following parameters are available in the sqlserver_features type.
A hash of switches you want to pass to the installer
Either domain user name or system account. Defaults to "NT AUTHORITY\NETWORK SERVICE"
Password for domain user.
namevar
Due to our prefetch and unaware of what name the user will provide we munge the value to meet our expecations.
Specify the SQL Server product key to configure which edition you would like to use.
The specific backend to use for this sqlserver_features resource. You will seldom need to specify this --- Puppet will
usually discover the appropriate provider for your platform.
Location of the source files.
Specify the location of the Windows Feature source files. This may be needed to install the .Net Framework. See https://support.microsoft.com/en-us/kb/2734782 for more information.
Namevar
The following properties are available in the sqlserver_instance type.
Valid values: present, absent
The basic property that the resource should be in.
Default value: present
Valid values: SQL, SQLEngine, Replication, FullText, DQ, AS, RS, POLYBASE, ADVANCEDANALYTICS
Specifies features to install, uninstall, or upgrade. The list of top-level features include SQLEngine, Replication, FullText, DQ AS, and RS. The 'SQL' feature is deprecated. Instead specify 'DQ', 'FullText', 'Replication', and 'SQLEngine' explicitly.
The following parameters are available in the sqlserver_instance type.
agt_svc_accountagt_svc_passwordas_svc_accountas_svc_passwordas_sysadmin_accountsinstall_switchesnamepidpolybase_svc_accountpolybase_svc_passwordproviderrs_svc_accountrs_svc_passwordsa_pwdsecurity_modesourcesql_svc_accountsql_svc_passwordsql_sysadmin_accountswindows_feature_source
Either domain user name or system account
Password for domain user name. Not required for system account
The account used by the Analysis Services service.
The password for the Analysis Services service account.
Specifies the list of administrator accounts to provision.
A hash of switches you want to pass to the installer
namevar
Namevar
Specify the SQL Server product key to configure which edition you would like to use.
The account used by the Polybase Engine service. Only applicable for SQL Server 2016+.
The password for the Polybase Engine service account. Only applicable for SQL Server 2016+.
The specific backend to use for this sqlserver_instance resource. You will seldom need to specify this --- Puppet will
usually discover the appropriate provider for your platform.
Specify the service account of the report server. This value is required. If you omit this value, Setup will use the default built-in account for the current operating system (either NetworkService or LocalSystem). If you specify a domain user account, the domain must be under 254 characters and the user name must be under 20 characters. The account name cannot contain the following characters: " / \ [ ] : ; | = , + * ? < >
Specify a strong password for the account. A strong password is at least 8 characters and includes a combination of upper and lower case alphanumeric characters and at least one symbol character. Avoid spelling an actual word or name that might be listed in a dictionary.
Required when :security_mode => "SQL"
Valid values: SQL
Specifies the security mode for SQL Server. If this parameter is not supplied, then Windows-only authentication mode is supported. Supported value: SQL
Location of source files.
Account for SQL Server service: Domain\User or system account.
A SQL Server service password is required only for a domain account.
Windows account(s) to provision as SQL Server system administrators.
Specify the location of the Windows Feature source files. This may be needed to install the .Net Framework. See https://support.microsoft.com/en-us/kb/2734782 for more information.
Namevar
The following properties are available in the sqlserver_tsql type.
SQL Query to run and only run if exits with non-zero
Returns the result of the executed command
Default value: 0
The following parameters are available in the sqlserver_tsql type.
command to run against an instance with the authenticated credentials used in sqlserver::config
initial database to connect to during query execution
Default value: master
requires the usage of sqlserver::config with the user and password
namevar
Namevar
The specific backend to use for this sqlserver_tsql resource. You will seldom need to specify this --- Puppet will
usually discover the appropriate provider for your platform.
Type: Ruby 4.x API
arguments that return string holds is conditional and decided by the the input given to function.
arguments that return string holds is conditional and decided by the the input given to function.
Returns: Variant[String] String
Generated on the basis of provided values.
Data type: Hash
contains Enum['ON', 'OFF'] $db_chaining Enum['ON', 'OFF'] $trustworthy String[1] $default_fulltext_language String[1] $default_language Optional[Enum['ON', 'OFF']] $nested_triggers Optional[Enum['ON', 'OFF']] $transform_noise_words Integer[1753, 9999] $two_digit_year_cutoff
Type: Ruby 3.x API
The sqlserver_is_domain_or_local_user function.
The sqlserver_is_domain_or_local_user function.
Returns: Boolean Returns true is the username is for local/domain.
Type: Ruby 3.x API
The sqlserver_upcase function.
The sqlserver_upcase function.
Returns: Any Upcase values
Type: Ruby 3.x API
The sqlserver_validate_hash_uniq_values function.
The sqlserver_validate_hash_uniq_values function.
Returns: String Returns the arguments or a message with the duplicate values.
Type: Ruby 3.x API
The sqlserver_validate_instance_name function.
The sqlserver_validate_instance_name function.
Returns: Any Error if not a valid instance name.
Type: Ruby 3.x API
The sqlserver_validate_range function.
The sqlserver_validate_range function.
Returns: Any Error if value is not between range
Type: Ruby 3.x API
The sqlserver_validate_size function.
The sqlserver_validate_size function.
Returns: Any Error if not a valid size value
Retrieve information about the logins configured for a SQL Server instance.
Supports noop? false
Data type: Optional[Variant[Array[String], String]]
The name of the SQL Instance running on the machine to connect to. Leave blank for the default instance of MSSQLSERVER
Data type: Optional[Variant[Array[String], String]]
The name of a particular login to search for. You can use partial names and any pattern that will work with the PowerShell '-match' operator.
Data type: Optional[Boolean]
If set to true it will force names passed to the LoginName parameter to be an exact match to a SQL Login to pass the filter.
Data type: Optional[Boolean]
Return more detailed information from the server instead of the default summary information
Return information about SQL Agent jobs and job steps.
Supports noop? false
Data type: Optional[Variant[Array[String],String]]
The instance to get job information from
Data type: Optional[Variant[Array[String],String]]
The name or the pattern to match of the job to search for.
Data type: Optional[Boolean]
Use only exact name matches for the job_name parameter instead of the default fuzzy matching.
Set IsDisabled, and Password properties of a SQL Login
Supports noop? true
Data type: Optional[Variant[Array[String],String]]
Instance that has the login to be modified. Leave blank for default instance.
Data type: Variant[Array[String],String]
Name of the login to modify. Matches are exact only by default.
Data type: Optional[Boolean]
Allow -match operator matches on $login_name so that inputs like 'sql' will match any login with 'sql' anywhere in the name.
Data type: Optional[Boolean]
Enable or disable an account. Set this to false to disable the account.
Data type: Optional[String]
The password to set for an account.
Start SQL Agent jobs on a server. You can start at a specified job step number (zero based indexes), and you can either wait on the job to complete, or return immediately.
Supports noop? false
Data type: Optional[Variant[Array[String],String]]
The instance to start a job on.
Data type: Variant[Array[String],String]
The name of the job to start.
Data type: Optional[Boolean]
Turn the job_name parameter into a pattern to match using the PowerShell -match operator.
Data type: Optional[Integer]
The zero based index number of the jop step to start from. Defaults to zero.
Data type: Optional[Boolean]
Wait for all jobs started to complete before returning data. Defaults to false such that the task will return immediately indicating only that the job was started.