Merge pull request #53 from nanliu/tb/travis

Add travis.ci to module
This commit is contained in:
Dan Bode 2012-03-20 17:31:45 -07:00
commit ce606a9525
4 changed files with 42 additions and 2 deletions

22
.travis.yml Normal file
View file

@ -0,0 +1,22 @@
language: ruby
rvm:
- 1.8.7
- 1.9.2
- ree
before_script:
- "[ '2.6.12' = $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:
- tb/travis
env:
- PUPPET_VERSION=2.6.12
- PUPPET_VERSION=2.7.6
- PUPPET_VERSION=2.7.9
matrix:
exclude:
- rvm: 1.9.2
env: PUPPET_VERSION=2.6.12
notifications:
email: false

13
Gemfile Normal file
View file

@ -0,0 +1,13 @@
source :rubygems
puppetversion = ENV.key?('PUPPET_VERSION') ? "= #{ENV['PUPPET_VERSION']}" : ['>= 2.7']
gem 'puppet', puppetversion
gem 'hiera', '>= 0.3.0'
gem 'hiera-puppet', '>= 0.3.0'
group :test do
gem 'rake', '>= 0.9.0'
gem 'rspec', '>= 2.8.0'
gem 'rspec-puppet', '>= 0.1.1'
end

View file

@ -64,11 +64,13 @@ define mysql::db (
require => Database_user["${user}@${host}"],
}
$refresh = ! $enforce_sql
if $sql {
exec{ "${name}-import":
command => "/usr/bin/mysql -u ${user} -p${password} -h ${host} ${name} < ${sql}",
logoutput => true,
refreshonly => ! $enforce_sql,
refreshonly => $refresh,
require => Database_grant["${user}@${host}/${name}"],
subscribe => Database[$name],
}

View file

@ -24,7 +24,10 @@ class mysql::server (
Class['mysql::server'] -> Class['mysql::config']
create_resources( 'class', {'mysql::config' => $config_hash} )
$config_class = {}
$config_class['mysql::config'] = $config_hash
create_resources( 'class', $config_class )
package { 'mysql-server':
name => $package_name,