Git Product home page Git Product logo

windows_sql's Introduction

windows_sql

This is the windows_sql puppet module.

##Description

This module allows you to generate and install SQL Server 2012 on windows Server. You can also configure maintenance plan.

This module have been tested with SQL Server 2012 SP1 on Windows Server 2012 R2. Should work, on Windows Server since 2012 and with SQL Server since 2012.

This module have been tested with puppet open source v3.5.1 and v3.6.2, the puppetmaster version is v3.4.3 (on ubuntu 14.04 LTS). Should work since version 3.5.1 of puppet

Last Fix/Update

v 0.0.9 :

  • Pull request 4 from StefanSchoof/master
  • Add pid when use master mode. (powershell)
  • Fix execution of installation script when using master mode

Generate configurationfile.ini

Generate Microsoft SQL Server 2012 file confsiguration from parameters you define. If you create your service account with windows_ad module and his xml file before calling the windows_sql class the password for each service account will be automatically retrieve from the users.xml file, else you can provide manually your password. All password manually provided have priority on xml password.

The user domain doesn't need to be provided, it will be supplied by the $env:userdomain powershell variable for each service account variable (like AGTSVCACCOUNT) and SQLSYSADMINACCOUNTS

Setup Requirements

Depends on the following modules:

Example

class {'windows_sql':
  features            => 'SQL,RS_SHP,RS_SHPWFE,TOOLS',
  pid                 => 'SYOUR-PRODU-CTKEY-OFSQL-2012S',
  sqlsysadminaccounts => 'SQLAdmin',
  agtsvcaccount       => 'svc_sqlagt',
  isopath             => 'C:\\Users\\Administrator\\Desktop\\SQLServer2012SP1-FullSlipstream-ENU-x64.iso',
  sqlsvcaccount       => 'svc_sqlsvc',
  securitymode        => 'sql',
  sapwd               => 'MySup3rGre@tp@ssw0rDO3nOT',
  mode                => 'master',
}

Parameters

Complete list and parameter options can be found on MSDN

SQL
	action              # Default Install. For now only Install, Uninstall action works
	features            # list of feature that should be install
	pid                 # product key. Default its empty.
	agtsvcaccount       # svc account for sql agt
	agtsvcpassword      # his password
	agtsvcstartuptype   # Startup. Default Automatic
	sqlpath             # install dir of SQL
	isopath             # iso path of SQL iso. Need [jriviere/windows_isos](https://forge.puppetlabs.com/jriviere/windows_isos) puppet module
	securitymode        # if SQL is supply sapwd is mandatory
	sapwd               # local admin of sql
	instancename        # instancename. Default MSSQLSERVER
	instanceid          # instanceid
	instancedir         # instancedir
	sqltempdbdir        # Default empty so, will use the default path of provide by sql
	sqltempdblogdir     # Default empty so, will use the default path of provide by sql
	sqluserdbdir        # Default empty so, will use the default path of provide by sql
	sqluserdblogdir     # Default empty so, will use the default path of provide by sql
	
	rssvcaccount        # When you provide one of this, specific options will be available.
	issvcaccount        # This 3, have same default account parameters as agtsvcpassword.
	assvcaccount        # If their features are provide and you don't provide them account, an error will occur.


Common parameter (default value)
	action                       # Install
	enu                          # true
	quiet                        # false
	quietsimple                  # true
	uimode                       # empty
	help                         # false
	indicateprogress             # false
	x86                          # false
	sqmreporting                 # false
	errorreporting               # false
	$sqlcollation                # Latin1_General_CI_AS
	tcpenabled                   # 1
	npenabled                    # 0
	browsersvcstartuptype        # Disabled
	iacceptsqlserverlicenseterms # true
	enableranu                   # false
	filestreamlevel              # 0
	forcerestart                 # Default : true
 

Other parameter
	configurationfile  # path of configurationfile.ini. Default C:\\configurationfile.ini
	userxml            # path of users.xml file created by [jriviere/windows_ad](https://forge.puppetlabs.com/jriviere/windows_ad) module. Default C:\\users.xml
	isopath            # Full iso path
	sqlpath            # for Drive use E:\\, for directory use C:\SQL where SQL is the folder that contains setup.exe
	mode               # the way how you want to deploy SQL, by using a master or only a agent. Default value agent.

##Plan Backup JOB Resource: windows_sql::maintenanceplan::backup

	windows_sql::maintenance::backup{'full':
	  backuptype   => 'FULL',
	  databases    => 'USER_DATABASES',
	  servername   => 'srvsql01',
	  jobname      => 'Full Backup - USER_Databases',
	  scheduletime => '021900',
	  schedulename => 'Daily Backup - Backup',
	  freq_type    => 'Daily'
	}
	windows_sql::maintenance::integritycheck{'integrity':
	  noindex      => 'N',
	  databases    => 'USER_DATABASES',
	  servername   => 'srvsql01',
	  jobname      => 'Check Integrity - USER_DATABASES',
	  scheduletime => '021100',
	  schedulename => 'Daily Backup - Integrity',
	  freq_type    => 'Daily'
	}
	windows_sql::maintenance::indexoptimize{'indexop':
	  databases    => 'USER_DATABASES',
	  servername   => 'srvsql01',
	  jobname      => 'Index Optimize - USER_DATABASES',
	  scheduletime => '023000',
	  schedulename => 'Daily Backup - Index Optimize',
	  freq_type    => 'Daily'
	}
	windows_sql::maintenance::deletebackuphistory{'delete':
	  servername   => 'srvsql01',
	  jobname      => 'Delete Backup History',
	  scheduletime => '030000',
	  schedulename => 'Daily Backup - Delete History',
	  freq_type    => 'Daily'
	}

Parameters:

	$databases           # Database to maintain
	$directory           # Directory to save backup
	$backuptype          # FULL, LOG, DIFF. Default FULL
	$verify              # 'N' or 'Y'
	$compress            # 'Y' or 'N'
	$servername          # 
	$fragmentationlow    # 'NULL',
	$fragmentationmedium # 'INDEX_REORGANIZE,INDEX_REBUILD_ONLINE,INDEX_REBUILD_OFFLINE',
	$fragmentationhigh   # 'INDEX_REBUILD_ONLINE,INDEX_REBUILD_OFFLINE',
	$fragmentationlevel1 # 5,
	$fragmentationlevel2 # 30,
	$noindex             # 'N' or 'Y', don't create index ?
	$checkcommands       # List of Available commands on ola hallengren site
	$scriptpath          # Where to save the maintenance script. Default C:\\Puppet-SQL
	$jobname             # Job Name
	$scheduletime        # Time to execute ex : 020000 -> exec at 02am
	$schedulename        # Scheduled name
	$freq_type           # Can be once, daily, Weekly, Monthly
	$freq_freq_interval  # Can be empty or any days of the week
	$daystokeep          # Number of days to keep backup. Default 7 (one week).

Known issues

If you declare the users with windows_ad::users in the same manifest of windows_sql Class, a error will occur and will inform you that you haven't provide a password. You need to declare your users first and then declare your SQL class (users must exist in AD before calling SQL class).

License

Apache License, Version 2.0

Contact

Jerome RIVIERE

Support

Please log tickets and issues on GitHub

windows_sql's People

Contributors

ninja-2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

windows_sql's Issues

Security Mode Issue

Hello,

We are having issues with the security mode.
We want to use windows-only instead of SQL, but when we dont supply any value to get windows-only, we always end-up with this error:

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Security mode only support SQL value, if no value is supplied, then Windows-Only authentication mode is used at /etc/puppet/environments/production/modules/windows_sql/manifests/params.pp:151

Is there anything we are missing?

Thanks

Passwords in plaintext on c:

I like this module quite a bit, but is there a way to accomplish the install without leaving the configuration files containing all the passwords on the c: after its completed?

sqlsvcpassword can't include $ character

If the value of sqlsvcpassword contains a $ character, it isn't passed correctly. I fixed it in my copy by changing the way it is passed to be similar to how the sapwd is passed ie:

'"<%= @sqlsvcpassword %>"'

But I'm sure I broke the support you coded for your AD tool.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.