Skip to content

(docs) Several docs updates #129

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 13, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,13 @@ For more information about installer switches and configuring SQL Server, see th

Executes a TSQL query against a SQL Server instance.

Requires the `sqlserver::config` define for access to the parent instance.

* `command`: *Optional.* Supplies a TSQL statement to execute. Valid options: a string.

* `instance`: *Required.* Specifies the SQL Server instance on which to execute the statement. Valid options: a string containing the name of an existing instance. Default: 'MSSQLSERVER'.
* `instance`: *Required.* Specifies the SQL Server instance on which to execute the statement. Valid options: a string containing the name of an existing instance. Default: 'MSSQLSERVER'.

* `database`: *Optional* Specifies the default database to connect to. Default: 'master'

* `onlyif`: *Optional.* Supplies a TSQL statement to execute before running the `command` statement, determining whether to move forward. If the `onlyif` statement ends with a THROW or any non-standard exit, Puppet executes the `command` statement. Valid options: a string.

Expand Down Expand Up @@ -306,7 +310,7 @@ Requires the `sqlserver::config` define for access to the parent instance.

* `log_filegrowth`: *Optional.* Specifies the automatic growth increment of the log file. Cannot be specified if `os_file_name` is set to a UNC path. Does not apply to a FILESTREAM filegroup. This parameter is set at creation only; it is not affected by updates. Valid options: a number with an optional suffix of 'KB', 'MB', 'GB', or 'TB', no greater than the value of `log_maxsize`. If you do not include a suffix, SQL Server assumes the number is in megabytes. Default: undef.

* `log_filename`: *Required if `log_name` is specified.* Specifies the operating system (physical) name of the log file. This parameter is set at creation only; it is not affected by updates. Valid options: a string. Default: undef.
* `log_filename`: *Required if `log_name` is specified.* Specifies the operating system (physical) name of the log file. This parameter is set at creation only; it is not affected by updates. Valid options: a string containing an absolute path. Default: undef.

* `log_maxsize`: *Optional.* Specifies the maximum size to which the log file can grow. Cannot be specified if `os_file_name` is set to a UNC path. This parameter is set at creation only; it is not affected by updates. Valid options: a number, no greater than 2147483647, with an optional suffix of 'KB', 'MB', 'GB', or 'TB'. If you do not include a suffix, SQL Server assumes the number is in megabytes. Default: undef.

Expand Down
7 changes: 4 additions & 3 deletions lib/puppet/type/sqlserver_tsql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,28 @@ def self.checks
@checks.keys
end

desc 'command to run against an instance with the authenticated credentials used in sqlserver::config'
newparam(:command, :parent => Puppet::Property::SqlserverTsql) do
desc 'command to run against an instance with the authenticated credentials used in sqlserver::config'

end

desc 'requires the usage of sqlserver::config with the user and password'
newparam(:instance) do
desc 'requires the usage of sqlserver::config with the user and password'
munge do |value|
value.upcase
end
end

newparam(:database) do
desc 'initial database to connect to during query execution'
defaultto 'master'
validate do |value|
fail("Invalid database name #{value}") unless /^[[:word:]|#|@]+/.match(value)
end
end

desc 'SQL Query to run and only run if exits with non-zero'
newcheck(:onlyif, :parent => Puppet::Property::SqlserverTsql) do
desc 'SQL Query to run and only run if exits with non-zero'
#Runs in the event that our TSQL exits with anything other than 0
def check(value)
output = provider.run(value)
Expand Down