mirror of
https://github.com/nikdoof/vapemap.git
synced 2025-12-18 12:19:24 +00:00
Vagrant Support
Brings in the basic config for Vagrant, missing elasticsearch but its enough to bring up a Vagrant instance of the main web app.
This commit is contained in:
34
puppet/manifests/classes/mysql.pp
Normal file
34
puppet/manifests/classes/mysql.pp
Normal file
@@ -0,0 +1,34 @@
|
||||
# Get mysql up and running
|
||||
class mysql {
|
||||
package { "mysql-server":
|
||||
ensure => installed,
|
||||
}
|
||||
|
||||
case $operatingsystem {
|
||||
ubuntu: {
|
||||
package { "libmysqld-dev":
|
||||
ensure => installed,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
service { "mysql":
|
||||
ensure => running,
|
||||
enable => true,
|
||||
require => Package['mysql-server'],
|
||||
}
|
||||
}
|
||||
|
||||
define mysql::database($user, $password) {
|
||||
exec { "create-${name}-db":
|
||||
unless => "/usr/bin/mysql -uroot ${name}",
|
||||
command => "/usr/bin/mysql -uroot -e \"create database ${name};\"",
|
||||
require => Service["mysql"],
|
||||
}
|
||||
|
||||
exec { "grant-${name}-db":
|
||||
unless => "/usr/bin/mysql -u${user} -p${password} ${name}",
|
||||
command => "/usr/bin/mysql -uroot -e \"grant all on ${name}.* to ${user}@localhost identified by '$password';\"",
|
||||
require => [Service["mysql"], Exec["create-${name}-db"]]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user