Skip to content

Commit

Permalink
Updating mysql config
Browse files Browse the repository at this point in the history
  • Loading branch information
BDQ committed Nov 18, 2012
1 parent 8d08827 commit 475e3eb
Show file tree
Hide file tree
Showing 113 changed files with 3,622 additions and 1,578 deletions.
17 changes: 0 additions & 17 deletions modules/augeas/README

This file was deleted.

19 changes: 0 additions & 19 deletions modules/augeas/lib/facter/augeasversion.rb

This file was deleted.

48 changes: 0 additions & 48 deletions modules/augeas/manifests/classes/augeas.pp

This file was deleted.

1 change: 0 additions & 1 deletion modules/augeas/manifests/init.pp

This file was deleted.

87 changes: 13 additions & 74 deletions modules/dbserver/manifests/init.pp
@@ -1,40 +1,14 @@
class dbserver {
# only required for 10.04 -- need to drop support for it.
# include mysql::server
case $db_server_type {
'medium': { include mysql::server::medium }
'large': { include mysql::server::large }
'huge': { include mysql::server::huge }
default: { include mysql::server::medium }
class { 'mysql::server':
config_hash => { 'root_password' => 'foo' }
}

#puppet clients 2.7.14 or later don't need custom augeas lens
#older versions do, hence this case statement
case $puppetversion {
"2.7.14":{
mysql::config {
'bind-address':
value => $db_server,
notify => Service["mysql"]
mysql::server::config { 'testfile':
settings => {
'mysqld' => {
'bind-address' => db_server,
}
}
default: {
file { "/usr/share/augeas/lenses/contrib/mysql.aug":
ensure => present,
source => "puppet:///dbserver/mysql.aug",
}

augeas { "my.cnf/mysqld-spree":
context => "${mysql::params::mycnfctx}/mysqld/",
load_path => "/usr/share/augeas/lenses/contrib/",
changes => [
"set bind-address ${db_server}",
],
require => [ File["/etc/mysql/my.cnf"], File["${mysql::params::data_dir}"] ],
notify => Service["mysql"],
}

}
}

case $db_pass {
Expand All @@ -43,50 +17,15 @@
}
}

# nested defines needed to get permissions
# set correctly for each app and ip pair
# $app_name is an array, so is $app_server_ips
#
define mysql-user(){
mysql-user-rights{$app_name:
ip => $name
}
}
define mysql-user-rights($ip){
if $deploy_demo {
mysql::rights{"demo-${name}-rights-${ip}":
ensure => present,
database => $name,
user => "spree",
host => $db_server ? {
'127.0.0.1' => 'localhost',
default => $name
},
password => $db_pass,
notify => Exec['reset database for demo'],
require => Mysql::Database["${name}"]
}
}else{
mysql::rights{"${name}-rights-${ip}":
ensure => present,
database => $name,
user => "spree",
host => $db_server ? {
'127.0.0.1' => 'localhost',
default => $name
},
password => $db_pass,
require => Mysql::Database["${name}"]
}
}
}

mysql-user{$app_server_ips:}

mysql::database{$app_name:
ensure => present
define db-for-app(){
mysql::db { "${name}":
user => $name,
password => $db_pass,
host => $app_server_ips,
}
}

db-for-app($app_name:)

# only spree app can get demo deployed,
# so the name is hardcoded on purpose
Expand Down
5 changes: 5 additions & 0 deletions modules/mysql/.fixtures.yml
@@ -0,0 +1,5 @@
fixtures:
repositories:
"stdlib": "git://github.com/puppetlabs/puppetlabs-stdlib"
symlinks:
"mysql": "#{source_dir}"
5 changes: 5 additions & 0 deletions modules/mysql/.gemfile
@@ -0,0 +1,5 @@
source :rubygems

puppetversion = ENV.key?('PUPPET_VERSION') ? "= #{ENV['PUPPET_VERSION']}" : ['>= 2.7']
gem 'puppet', puppetversion
gem 'puppetlabs_spec_helper', '>= 0.1.0'
2 changes: 2 additions & 0 deletions modules/mysql/.gitignore
@@ -0,0 +1,2 @@
*.swp
pkg/
17 changes: 17 additions & 0 deletions modules/mysql/.travis.yml
@@ -0,0 +1,17 @@
language: ruby
rvm:
- 1.8.7
before_script:
- "[ '2.6.9' = $PUPPET_VERSION ] && git clone git://github.com/puppetlabs/puppetlabs-create_resources.git spec/fixtures/modules/create_resources || true"
after_script:
script: "rake spec"
branches:
only:
- master
env:
- PUPPET_VERSION=2.7.13
- PUPPET_VERSION=2.7.6
- PUPPET_VERSION=2.6.9
notifications:
email: false
gemfile: .gemfile
128 changes: 128 additions & 0 deletions modules/mysql/CHANGELOG
@@ -0,0 +1,128 @@
2012-08-23 - Version 0.5.0
* Add puppetlabs/stdlib as requirement
* Add validation for mysql privs in provider
* Add `pidfile` parameter to mysql::config
* Add `ensure` parameter to mysql::db
* Add Amazon linux support
* Change `bind_address` parameter to be optional in my.cnf template
* Fix quoting root passwords

2012-07-24 - Version 0.4.0
* Fix various bugs regarding database names
* FreeBSD support
* Allow specifying the storage engine
* Add a backup class
* Add a security class to purge default accounts

2012-05-03 - Version 0.3.0
* #14218 Query the database for available privileges
* Add mysql::java class for java connector installation
* Use correct error log location on different distros
* Fix set_mysql_rootpw to properly depend on my.cnf

2012-04-11 - Version 0.2.0

2012-03-19 - William Van Hevelingen <blkperl@cat.pdx.edu>
* (#13203) Add ssl support (f7e0ea5)

2012-03-18 - Nan Liu <nan@puppetlabs.com>
* Travis ci before script needs success exit code. (0ea463b)

2012-03-18 - Nan Liu <nan@puppetlabs.com>
* Fix Puppet 2.6 compilation issues. (9ebbbc4)

2012-03-16 - Nan Liu <nan@puppetlabs.com>
* Add travis.ci for testing multiple puppet versions. (33c72ef)

2012-03-15 - William Van Hevelingen <blkperl@cat.pdx.edu>
* (#13163) Datadir should be configurable (f353fc6)

2012-03-16 - Nan Liu <nan@puppetlabs.com>
* Document create_resources dependency. (558a59c)

2012-03-16 - Nan Liu <nan@puppetlabs.com>
* Fix spec test issues related to error message. (eff79b5)

2012-03-16 - Nan Liu <nan@puppetlabs.com>
* Fix mysql service on Ubuntu. (72da2c5)

2012-03-16 - Dan Bode <dan@puppetlabs.com>
* Add more spec test coverage (55e399d)

2012-03-16 - Nan Liu <nan@puppetlabs.com>
* (#11963) Fix spec test due to path changes. (1700349)

2012-03-07 - François Charlier <fcharlier@ploup.net>
* Add a test to check path for 'mysqld-restart' (b14c7d1)

2012-03-07 - François Charlier <fcharlier@ploup.net>
* Fix path for 'mysqld-restart' (1a9ae6b)

2012-03-15 - Dan Bode <dan@puppetlabs.com>
* Add rspec-puppet tests for mysql::config (907331a)

2012-03-15 - Dan Bode <dan@puppetlabs.com>
* Moved class dependency between sever and config to server (da62ad6)

2012-03-14 - Dan Bode <dan@puppetlabs.com>
* Notify mysql restart from set_mysql_rootpw exec (0832a2c)

2012-03-15 - Nan Liu <nan@puppetlabs.com>
* Add documentation related to osfamily fact. (8265d28)

2012-03-14 - Dan Bode <dan@puppetlabs.com>
* Mention osfamily value in failure message (e472d3b)

2012-03-14 - Dan Bode <dan@puppetlabs.com>
* Fix bug when querying for all database users (015490c)

2012-02-09 - Nan Liu <nan@puppetlabs.com>
* Major refactor of mysql module. (b1f90fd)

2012-01-11 - Justin Ellison <justin.ellison@buckle.com>
* Ruby and Python's MySQL libraries are named differently on different distros. (1e926b4)

2012-01-11 - Justin Ellison <justin.ellison@buckle.com>
* Per @ghoneycutt, we should fail explicitly and explain why. (09af083)

2012-01-11 - Justin Ellison <justin.ellison@buckle.com>
* Removing duplicate declaration (7513d03)

2012-01-10 - Justin Ellison <justin.ellison@buckle.com>
* Use socket value from params class instead of hardcoding. (663e97c)

2012-01-10 - Justin Ellison <justin.ellison@buckle.com>
* Instead of hardcoding the config file target, pull it from mysql::params (031a47d)

2012-01-10 - Justin Ellison <justin.ellison@buckle.com>
* Moved $socket to within the case to toggle between distros. Added a $config_file variable to allow per-distro config file destinations. (360eacd)

2012-01-10 - Justin Ellison <justin.ellison@buckle.com>
* Pretty sure this is a bug, 99% of Linux distros out there won't ever hit the default. (3462e6b)

2012-02-09 - William Van Hevelingen <blkperl@cat.pdx.edu>
* Changed the README to use markdown (3b7dfeb)

2012-02-04 - Daniel Black <grooverdan@users.sourceforge.net>
* (#12412) mysqltuner.pl update (b809e6f)

2011-11-17 - Matthias Pigulla <mp@webfactory.de>
* (#11363) Add two missing privileges to grant: event_priv, trigger_priv (d15c9d1)

2011-12-20 - Jeff McCune <jeff@puppetlabs.com>
* (minor) Fixup typos in Modulefile metadata (a0ed6a1)

2011-12-19 - Carl Caum <carl@carlcaum.com>
* Only notify Exec to import sql if sql is given (0783c74)

2011-12-19 - Carl Caum <carl@carlcaum.com>
* (#11508) Only load sql_scripts on DB creation (e3b9fd9)

2011-12-13 - Justin Ellison <justin.ellison@buckle.com>
* Require not needed due to implicit dependencies (3058feb)

2011-12-13 - Justin Ellison <justin.ellison@buckle.com>
* Bug #11375: puppetlabs-mysql fails on CentOS/RHEL (a557b8d)

2011-06-03 - Dan Bode <dan@puppetlabs.com> - 0.0.1
* initial commit

0 comments on commit 475e3eb

Please sign in to comment.