Merge branch 'master' of https://github.com/puppetlabs/puppetlabs-mysql
Conflicts: manifests/config.pp
This commit is contained in:
commit
ead86b5a3f
10 changed files with 86 additions and 44 deletions
|
@ -1,6 +1,5 @@
|
|||
fixtures:
|
||||
repositories:
|
||||
"stdlib": "git://github.com/puppetlabs/puppetlabs-stdlib"
|
||||
"create_resources": "git://github.com/puppetlabs/puppetlabs-create_resources.git"
|
||||
symlinks:
|
||||
"mysql": "#{source_dir}"
|
||||
|
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,2 +1,3 @@
|
|||
*.swp
|
||||
pkg/
|
||||
Gemfile.lock
|
||||
|
|
39
.travis.yml
39
.travis.yml
|
@ -1,28 +1,39 @@
|
|||
branches:
|
||||
only:
|
||||
- master
|
||||
language: ruby
|
||||
bundler_args: --without development
|
||||
before_script:
|
||||
- "[ $PUPPET_GEM_VERSION ~> 2.6 ] && git clone git://github.com/puppetlabs/puppetlabs-create_resources.git spec/fixtures/modules/create_resources || true"
|
||||
script: "bundle exec rake spec SPEC_OPTS='--format documentation'"
|
||||
after_success:
|
||||
- git clone -q git://github.com/puppetlabs/ghpublisher.git .forge-release
|
||||
- .forge-release/publish
|
||||
rvm:
|
||||
- 1.8.7
|
||||
- 1.9.3
|
||||
- ruby-head
|
||||
- 2.0.0
|
||||
env:
|
||||
- PUPPET_GEM_VERSION="~> 2.6.0"
|
||||
- PUPPET_GEM_VERSION="~> 2.7.0"
|
||||
- PUPPET_GEM_VERSION="~> 3.0.0"
|
||||
- PUPPET_GEM_VERSION="~> 3.1.0"
|
||||
matrix:
|
||||
- PUPPET_GEM_VERSION="~> 2.7.0"
|
||||
- PUPPET_GEM_VERSION="~> 3.0.0"
|
||||
- PUPPET_GEM_VERSION="~> 3.1.0"
|
||||
- PUPPET_GEM_VERSION="~> 3.2.0"
|
||||
global:
|
||||
- PUBLISHER_LOGIN=puppetlabs
|
||||
- secure: |-
|
||||
Hc9OPm/kRTmjXSP3TbLir/y6Yy1LqmZS8zrqxdTbpo3Z04EYv1uKhaFDpECl
|
||||
0a6bJRUWpLWIuDco08fHMeCTWoFGzE97EDelhHKSYiTNllzYKWPHy7ki/al6
|
||||
wjz0gLtiDfmktHQOHatBy6EKLFjoyjGoE4cUUta4Ixq4tMBNzEA=
|
||||
matrix:
|
||||
allow_failures:
|
||||
- rvm: ruby-head
|
||||
exclude:
|
||||
- rvm: 1.9.3
|
||||
env: PUPPET_GEM_VERSION="~> 2.7.0"
|
||||
- rvm: ruby-head
|
||||
- rvm: 2.0.0
|
||||
env: PUPPET_GEM_VERSION="~> 2.7.0"
|
||||
- rvm: 1.9.3
|
||||
env: PUPPET_GEM_VERSION="~> 2.6.0"
|
||||
- rvm: ruby-head
|
||||
env: PUPPET_GEM_VERSION="~> 2.6.0"
|
||||
- rvm: 2.0.0
|
||||
env: PUPPET_GEM_VERSION="~> 3.0.0"
|
||||
- rvm: 2.0.0
|
||||
env: PUPPET_GEM_VERSION="~> 3.1.0"
|
||||
- rvm: 1.8.7
|
||||
env: PUPPET_GEM_VERSION="~> 3.2.0"
|
||||
notifications:
|
||||
email: false
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2013-07-26 - Version 0.7.1
|
||||
Bugfixes:
|
||||
- Single-quote password for special characters
|
||||
- Update travis testing for puppet 3.2.x and missing Bundler gems
|
||||
|
||||
2013-06-25 - Version 0.7.0
|
||||
This is a maintenance release for community bugfixes and exposing
|
||||
configuration variables.
|
||||
|
|
5
Gemfile
5
Gemfile
|
@ -1,7 +1,10 @@
|
|||
source :rubygems
|
||||
source 'https://rubygems.org'
|
||||
|
||||
group :development, :test do
|
||||
gem 'rake', :require => false
|
||||
gem 'rspec-puppet', :require => false
|
||||
gem 'puppetlabs_spec_helper', :require => false
|
||||
gem 'puppet-lint', :require => false
|
||||
end
|
||||
|
||||
if puppetversion = ENV['PUPPET_GEM_VERSION']
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
name 'puppetlabs-mysql'
|
||||
version '0.7.0'
|
||||
version '0.7.1'
|
||||
source 'git://github.com/puppetlabs/puppetlabs-mysql.git'
|
||||
author 'Puppet Labs'
|
||||
license 'Apache 2.0'
|
||||
|
|
|
@ -83,26 +83,26 @@
|
|||
# }
|
||||
#
|
||||
class mysql::config(
|
||||
$root_password = $mysql::root_password,
|
||||
$old_root_password = $mysql::old_root_password,
|
||||
$bind_address = $mysql::bind_address,
|
||||
$port = $mysql::port,
|
||||
$etc_root_password = $mysql::etc_root_password,
|
||||
$service_name = $mysql::service_name,
|
||||
$config_file = $mysql::config_file,
|
||||
$socket = $mysql::socket,
|
||||
$pidfile = $mysql::pidfile,
|
||||
$datadir = $mysql::datadir,
|
||||
$ssl = $mysql::ssl,
|
||||
$ssl_ca = $mysql::ssl_ca,
|
||||
$ssl_cert = $mysql::ssl_cert,
|
||||
$ssl_key = $mysql::ssl_key,
|
||||
$log_error = $mysql::log_error,
|
||||
$default_engine = $mysql::default_engine,
|
||||
$root_group = $mysql::root_group,
|
||||
$restart = $mysql::restart,
|
||||
$purge_conf_dir = $mysql::purge_conf_dir,
|
||||
|
||||
$root_password = $mysql::root_password,
|
||||
$old_root_password = $mysql::old_root_password,
|
||||
$bind_address = $mysql::bind_address,
|
||||
$port = $mysql::port,
|
||||
$etc_root_password = $mysql::etc_root_password,
|
||||
$manage_config_file = $mysql::manage_config_file,
|
||||
$service_name = $mysql::service_name,
|
||||
$config_file = $mysql::config_file,
|
||||
$socket = $mysql::socket,
|
||||
$pidfile = $mysql::pidfile,
|
||||
$datadir = $mysql::datadir,
|
||||
$ssl = $mysql::ssl,
|
||||
$ssl_ca = $mysql::ssl_ca,
|
||||
$ssl_cert = $mysql::ssl_cert,
|
||||
$ssl_key = $mysql::ssl_key,
|
||||
$log_error = $mysql::log_error,
|
||||
$default_engine = $mysql::default_engine,
|
||||
$root_group = $mysql::root_group,
|
||||
$restart = $mysql::restart,
|
||||
$purge_conf_dir = $mysql::purge_conf_dir,
|
||||
$key_buffer = $mysql::key_buffer,
|
||||
$max_allowed_packet = $mysql::max_allowed_packet,
|
||||
$thread_stack = $mysql::thread_stack,
|
||||
|
@ -182,6 +182,7 @@ class mysql::config(
|
|||
file { '/root/.my.cnf':
|
||||
content => template('mysql/my.cnf.pass.erb'),
|
||||
require => Exec['set_mysql_rootpw'],
|
||||
notify => undef,
|
||||
}
|
||||
|
||||
if $etc_root_password {
|
||||
|
@ -200,15 +201,18 @@ class mysql::config(
|
|||
ensure => directory,
|
||||
mode => '0755',
|
||||
}
|
||||
|
||||
file { '/etc/mysql/conf.d':
|
||||
ensure => directory,
|
||||
mode => '0755',
|
||||
recurse => $purge_conf_dir,
|
||||
purge => $purge_conf_dir,
|
||||
}
|
||||
file { $config_file:
|
||||
content => template('mysql/my.cnf.erb'),
|
||||
mode => '0644',
|
||||
}
|
||||
|
||||
if $manage_config_file {
|
||||
file { $config_file:
|
||||
content => template('mysql/my.cnf.erb'),
|
||||
mode => '0644',
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,6 +26,8 @@
|
|||
#
|
||||
# [*log_error*] - Where to log errors
|
||||
#
|
||||
# [*manage_config_file*] - if the config file should be managed (default: true)
|
||||
#
|
||||
# [*manage_service*] - Boolean dictating if mysql::server should manage the service
|
||||
#
|
||||
# [*max_allowed_packet*] - Maximum network packet size mysqld will accept
|
||||
|
@ -93,6 +95,7 @@ class mysql(
|
|||
$etc_root_password = $mysql::params::etc_root_password,
|
||||
$java_package_name = $mysql::params::java_package_name,
|
||||
$log_error = $mysql::params::log_error,
|
||||
$manage_config_file = true,
|
||||
$manage_service = $mysql::params::manage_service,
|
||||
$max_allowed_packet = $mysql::params::max_allowed_packet,
|
||||
$old_root_password = $mysql::params::old_root_password,
|
||||
|
|
|
@ -78,6 +78,22 @@ describe 'mysql::config' do
|
|||
{:osfamily => osfamily}
|
||||
end
|
||||
|
||||
describe 'when config file should be managed' do
|
||||
let :params do
|
||||
{:manage_config_file => true}
|
||||
end
|
||||
|
||||
it { should contain_file(osparams[:config_file]) }
|
||||
end
|
||||
|
||||
describe 'when config file should not be managed' do
|
||||
let :params do
|
||||
{:manage_config_file => false}
|
||||
end
|
||||
|
||||
it { should_not contain_file(osparams[:config_file]) }
|
||||
end
|
||||
|
||||
describe 'when root password is set' do
|
||||
|
||||
let :params do
|
||||
|
@ -92,7 +108,7 @@ describe 'mysql::config' do
|
|||
)}
|
||||
|
||||
it { should contain_file('/root/.my.cnf').with(
|
||||
'content' => "[client]\nuser=root\nhost=localhost\npassword=foo\n",
|
||||
'content' => "[client]\nuser=root\nhost=localhost\npassword='foo'\n",
|
||||
'require' => 'Exec[set_mysql_rootpw]'
|
||||
)}
|
||||
|
||||
|
@ -281,7 +297,7 @@ describe 'mysql::config' do
|
|||
)}
|
||||
|
||||
it { should contain_file('/root/.my.cnf').with(
|
||||
'content' => "[client]\nuser=root\nhost=localhost\npassword=foo\n",
|
||||
'content' => "[client]\nuser=root\nhost=localhost\npassword='foo'\n",
|
||||
'require' => 'Exec[set_mysql_rootpw]'
|
||||
)}
|
||||
|
||||
|
|
|
@ -2,5 +2,5 @@
|
|||
user=root
|
||||
host=localhost
|
||||
<% unless @root_password == 'UNSET' -%>
|
||||
password=<%= @root_password %>
|
||||
password='<%= @root_password %>'
|
||||
<% end -%>
|
||||
|
|
Loading…
Reference in a new issue