Skip to content

Commit

Permalink
Merge pull request #31 from jordiprats/master
Browse files Browse the repository at this point in the history
percona repo related fixes
  • Loading branch information
jordiprats authored Apr 3, 2019
2 parents 407b77a + 254b950 commit 43e209e
Show file tree
Hide file tree
Showing 13 changed files with 67 additions and 94 deletions.
10 changes: 0 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,8 @@ matrix:
dist: trusty
bundler_args:
script: bundle exec rake validate
- rvm: default
env: BEAKER_set="centos6-docker"
dist: trusty
bundler_args:
script: sudo service docker restart ; sleep 10 && bundle exec rspec spec/acceptance/*_spec.rb
- rvm: default
env: BEAKER_set="centos7-docker"
dist: trusty
bundler_args:
script: sudo service docker restart ; sleep 10 && bundle exec rspec spec/acceptance/*_spec.rb
- rvm: default
env: BEAKER_set="ubuntu16-docker"
dist: trusty
bundler_args:
script: sudo service docker restart ; sleep 10 && bundle exec rspec spec/acceptance/*_spec.rb
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# CHANGELOG

## 0.4.18

* xtrabackup install needs to happen after mysql deployment
* added GPG for Percona: RPM-GPG-KEY-Percona

## 0.4.17

* Added option to handle extra options for mysqldump
Expand Down
2 changes: 1 addition & 1 deletion examples/mysqldump_extraopts.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@

mysql::backup::mysqldump { 'test':
destination => '/backup',
extraopts => '--quick',
extraopts => '--quick',
}
30 changes: 30 additions & 0 deletions files/percona/GPG-key-percona
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.9 (GNU/Linux)

mQGiBEsm3aERBACyB1E9ixebIMRGtmD45c6c/wi2IVIa6O3G1f6cyHH4ump6ejOi
AX63hhEs4MUCGO7KnON1hpjuNN7MQZtGTJC0iX97X2Mk+IwB1KmBYN9sS/OqhA5C
itj2RAkug4PFHR9dy21v0flj66KjB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QrLCoE+
/HyYvr2rxP94PT6Bkjk/aiCCPAKZRj5CFUKRpShfDIiow9qxtqv7yVd514Qqmjb4
eEihtcjltGAoS54+6C3lbjrHUQhLwPGqlAh8uZKzfSZq0C06kTxiEqsG6VDDYWy6
L7qaMwOqWdQtdekKiCk8w/FoovsMYED2qlWEt0i52G+0CjoRFx2zNsN3v4dWiIhk
ZSL00Mx+g3NA7pQ1Yo5Vhok034mP8L2fBLhhWaK3LG63jYvd0HLkUFhNG+xjkpeI
SQQYEQIACQUCSybdoQIbDAAKCRAcTL3NzS79KlacAJ0aAkBQapIaHNvmAhtVjLPN
wke4ZgCePe3sPPF49lBal7QaYPdjqapa1SQ=
=qcCk
-----END PGP PUBLIC KEY BLOCK-----
1 change: 1 addition & 0 deletions manifests/backup/xtrabackup.pp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
#
if(!defined(Class['mysql::backup::xtrabackup::install']))
{
Service <| tag == 'mysqlservice' |> ->
class { 'mysql::backup::xtrabackup::install':
version => $xtrabackup_version,
}
Expand Down
1 change: 1 addition & 0 deletions manifests/community/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
service { "mysqlcommunity@${instance_name}":
ensure => $service_ensure,
enable => $service_enable,
tag => 'mysqlservice',
}
}
}
Expand Down
19 changes: 18 additions & 1 deletion manifests/perconarepo.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,23 @@
path => '/usr/sbin:/usr/bin:/sbin:/bin',
}

$percona_gpg_path='/etc/pki/rpm-gpg/RPM-GPG-KEY-Percona'

file { $percona_gpg_path:
ensure => 'present',
owner => 'root',
group => 'root',
mode => '0644',
content => file("${module_name}/percona/GPG-key-percona"),
}

exec { 'import-percona-gpg':
command => "rpm --import ${percona_gpg_path}",
path => ['/bin', '/usr/bin'],
unless => "rpm -q gpg-pubkey-$(gpg --throw-keyids ${percona_gpg_path} | grep pub | cut -c 12-19 | tr '[A-Z]' '[a-z]')",
require => File[$percona_gpg_path],
}

exec { "mysql perconarepo srcdir ${srcdir}":
command => "mkdir -p ${srcdir}",
creates => $srcdir,
Expand All @@ -28,7 +45,7 @@
ensure => $package_ensure,
provider => $mysql::params::package_provider,
source => "${srcdir}/repo_perconarepo.${mysql::params::package_provider}",
require => Exec['wget perconarepo'],
require => Exec[['wget perconarepo','import-percona-gpg']],
notify => Exec['perconarepo install update'],
}

Expand Down
1 change: 1 addition & 0 deletions manifests/xtradbcluster/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
service { "xtradbcluster@${instance_name}":
ensure => $service_ensure,
enable => $service_enable,
tag => 'mysqlservice',
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eyp-mysql",
"version": "0.4.17",
"version": "0.4.18",
"author": "eyp",
"summary": "multi instance mysql community and Percona XtraDB cluster (galera)",
"license": "Apache-2.0",
Expand Down
21 changes: 0 additions & 21 deletions spec/acceptance/base_spec.rb

This file was deleted.

2 changes: 1 addition & 1 deletion spec/acceptance/community_instance_mysqldump_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
its(:content) { should match '[mysqld]' }
end

describe file("/etc/mysql/test/my.cnf") do
describe file("/etc/mysql/test_mysqldump/my.cnf") do
it { should be_file }
its(:content) { should match '[mysqld]' }
end
Expand Down
13 changes: 8 additions & 5 deletions spec/acceptance/community_instance_xtrabackup_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,21 @@
pp = <<-EOF
mysql::community::instance { 'test_xtrabackup':
port => '3308',
port => '3408',
password => 'password',
add_default_mycnf => true,
default_instance => true,
}
->
mysql::backup::xtrabackup { 'test_xtrabackup':
destination => '/backup',
}
mysql_database { 'et2blog':
ensure => 'present',
instance_name => 'test_xtrabackup',
}
EOF

# Run it twice and test for idempotency
Expand All @@ -50,7 +53,7 @@
end

it "check db and mysql access" do
expect(shell("echo show databases | mysql | grep et2blog").exit_code).to be_zero
expect(shell("echo show databases | mysql --defaults-group-suffix=test_xtrabackup | grep et2blog").exit_code).to be_zero
end

#instance tomcat-8080 HTTP connector
Expand All @@ -63,7 +66,7 @@
its(:content) { should match '[mysqld]' }
end

describe file("/etc/mysql/test/my.cnf") do
describe file("/etc/mysql/test_xtrabackup/my.cnf") do
it { should be_file }
its(:content) { should match '[mysqld]' }
end
Expand Down
54 changes: 0 additions & 54 deletions spec/acceptance/zz_percona_toolkit_spec.rb

This file was deleted.

0 comments on commit 43e209e

Please sign in to comment.