Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

"createdb.rb" creates empty MSSQL databases from settings inside data bags

View createdb.rb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
#
# Author:: Steven Craig <support@smashrun.com>
# Cookbook Name:: windows
# Attributes:: createdb
#
# Copyright 2010, Smashrun, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
 
# these are standard
default[:createdb][:author_name] = "Steve Craig"
default[:createdb][:author_email] = "support@smashrun.com"
default[:createdb][:tempdir] = "c:\\chef\\tmp\\"
 
# shared among all db instances
default[:createdb][:sqlscripts] = "D:\\MSSQL\\sqlscripts"
 
# this is a DIRTY hack because i didnt spend the time to get the directory working inside the backup_db.rb script
# this should be fixed to be a solr search from the databag AS SOON AS POSSIBLE
default[:createdb][:backupdir] = "D:\\MSSQL\\Backup"
default[:createdb][:restoredir] = "D:\\MSSQL\\Restore"
 
# utilized primarily by the templates
default[:createdb][:sqlsausername] = "sa"
 
# this should be an if..then depending on the version of SQL Server (future functionality)
default[:createdb][:sqlcmd_path] = "C:\\Program Files\\Microsoft SQL Server\\90\\Tools\\Binn"
default[:createdb][:executesql_bat] = "execute_sql.bat"
default[:createdb][:executesql_template] = "createdb-#{node[:createdb][:executesql_bat]}.erb"
default[:createdb][:basesql] = "create.sql"
 
 
# sql tools future functionality
if node[:kernel][:machine] == "x86_64"
default[:createdb][:url] = "http://localhost"
default[:createdb][:installer] = "sql_bundle.exe"
else
if node[:kernel][:machine] == "i386"
default[:createdb][:url] = "http://localhost"
default[:createdb][:installer] = "sql_bundle.exe"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.