Skip to content

Instantly share code, notes, and snippets.

@cixelsyd
cixelsyd / backupdb.rb
Created December 17, 2011 20:45
"backupdb.rb" is the main recipe inside of a larger "backupdb" role
#
# Cookbook Name:: smashrun
# Recipe:: backupdb
#
# Copyright 2010, Smashrun, Inc.
# Author:: Steven Craig <support@smashrun.com>
#
# 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
@cixelsyd
cixelsyd / createdb.rb
Created December 17, 2011 20:48
"createdb.rb" creates empty MSSQL databases from settings inside data bags
#
# Author:: Steven Craig <support@smashrun.com>
# Cookbook Name:: windows
# Recipe:: 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
@cixelsyd
cixelsyd / postrestoredb.rb
Created December 17, 2011 21:10
"postrestoredb.rb" updates schema of MSSQL databases from data bag settings after they have been refreshed
#
# Cookbook Name:: smashrun
# Recipe:: postrestoredb.rb
#
# Copyright 2010, Smashrun, Inc.
# Author:: Steven Craig <support@smashrun.com>
#
# 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
@cixelsyd
cixelsyd / restoredb-restore.sql.erb
Created December 17, 2011 21:36
"restoredb.rb" recipe needs templated T-SQL script to restore database
--
-- Author:: <%= @author_name %> / <%= @author_email %>
-- Cookbook Name:: smashrun
-- Templates:: <%= @basesql_template %>
--
-- 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
@cixelsyd
cixelsyd / backupdb.rb
Created December 17, 2011 20:42
"backupdb.rb" is the main recipe inside of a larger "backupdb" role
#
# Cookbook Name:: smashrun
# Attributes:: backupdb
#
# Copyright 2010, Smashrun, Inc.
# Author:: Steven Craig <support@smashrun.com>
#
# 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
@cixelsyd
cixelsyd / createdb.rb
Created December 17, 2011 20:49
"createdb.rb" creates empty MSSQL databases from settings inside data bags
#
# 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
@cixelsyd
cixelsyd / rsyncdb.rb
Created December 17, 2011 20:54
"rsyncdb.rb" zips and moves backups from settings inside data bags
#
# Cookbook Name:: smashrun
# Recipe:: rsyncdb
#
# Copyright 2010, Smashrun, Inc.
# Author:: Steven Craig <support@smashrun.com>
#
# 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
@cixelsyd
cixelsyd / restoredb.rb
Created December 17, 2011 21:06
"restoredb.rb" restores/refreshes MSSQL databases from data bag settings
#
# Cookbook Name:: smashrun
# Attributes:: restoredb
#
# Copyright 2010, Smashrun, Inc.
# Author:: Steven Craig <support@smashrun.com>
#
# 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
@cixelsyd
cixelsyd / createdb-execute_sql.bat.erb
Created December 17, 2011 21:21
"createdb.rb" recipe needs a templated batch file to execute arbitrary T-SQL
:: chef template <%= @executesql_template %>
:: becomes "<%= @executesql_bat %>" on the server
:: generic execute sql wrapper - <%= @author_name %> / <%= @author_email %>
:: requires chef / internet connectivity to opsware git repo
:: initial version 2011:09:19 15:01:00 EST
:: pass SQL sa passwd as ARG1
:: pass SQL script as ARG2
:: pass SQL logfile as ARG3
@cixelsyd
cixelsyd / createdb-create.sql.erb
Created December 17, 2011 21:22
"createdb.rb" recipe needs a templated T-SQL script to create databases
--
-- Author:: <%= @author_name %> / <%= @author_email %>
-- Cookbook Name:: windows
-- Templates:: <%= @basesql_template %>
--
-- 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