From 66135da4481b496c1954448a44274f66fdf624e8 Mon Sep 17 00:00:00 2001 From: Jens Harbott Date: Fri, 9 Oct 2020 07:50:23 +0200 Subject: [PATCH] Add notify to mariadb_galera_configuration Need to trigger a restart after changing the galera configuration. Change-Id: Ie148e8dce2e945ea956f6521c04bfc031f9da3f2 --- recipes/mariadb-cluster-server.rb | 1 + spec/mariadb-cluster-server_spec.rb | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/recipes/mariadb-cluster-server.rb b/recipes/mariadb-cluster-server.rb index 39889bf..0b91f9a 100644 --- a/recipes/mariadb-cluster-server.rb +++ b/recipes/mariadb-cluster-server.rb @@ -60,6 +60,7 @@ mariadb_galera_configuration 'MariaDB Galera Configuration' do gcomm_address gcomm_address wsrep_provider_options provider_options wsrep_sst_method 'rsync' + notifies :restart, 'service[mysql]', :immediately end # Install clustercheck tool diff --git a/spec/mariadb-cluster-server_spec.rb b/spec/mariadb-cluster-server_spec.rb index c4493d9..171f210 100644 --- a/spec/mariadb-cluster-server_spec.rb +++ b/spec/mariadb-cluster-server_spec.rb @@ -26,6 +26,10 @@ describe 'openstack-ops-database::mariadb-cluster-server' do ) end + it do + expect(chef_run.mariadb_galera_configuration('MariaDB Galera Configuration')).to notify('service[mysql]').to(:restart).immediately + end + it do expect(chef_run).to create_if_missing_cookbook_file('/usr/bin/clustercheck').with( source: 'clustercheck',