Created
November 20, 2015 16:01
-
-
Save marshyski/96c4c80815abed2bfbc9 to your computer and use it in GitHub Desktop.
Basic SQL Install with Puppet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Class to install SQL Server, set its configuration, create an | |
# instance, as well as a sample DB. | |
class app_sqlserver ( | |
$source = 'F:/', | |
$admin_user = 'Administrator', | |
$db_instance = 'MYINSTANCE', | |
$sa_pass = 'MySecretPASSWORD', | |
$db_name = 'sampledb', | |
) { | |
reboot { 'before install': | |
when => pending, | |
} | |
service { 'wuauserv': | |
ensure => running, | |
enable => true, | |
before => Windowsfeature['Net-Framework-Core'], | |
} | |
windowsfeature { 'Net-Framework-Core': | |
before => Sqlserver::Database[$db_name], | |
} | |
sqlserver_instance{ $db_instance: | |
ensure => present, | |
features => ['SQL'], | |
source => $source, | |
security_mode => 'SQL', | |
sa_pwd => $sa_pass, | |
sql_sysadmin_accounts => [$admin_user], | |
} | |
sqlserver_features { 'Management_Studio': | |
source => $source, | |
features => ['SSMS'], | |
} | |
sqlserver::config{ $db_instance: | |
admin_user => 'sa', | |
admin_pass => $sa_pass, | |
} | |
sqlserver::database{ $db_name: | |
ensure => present, | |
db_name => $db_name, | |
instance => $db_instance, | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
Thanks for this, I'm new to puppet so please forgive my questions if their answers appear obvious:) will this require an SQL class (for Puppet Enterprise to work!)