In order to make easy orchestration on all OpenStack db-sync, add this tag so people can use this tag in composition layer. A use case it to set some orchestration to make sure MySQL Galera is ready before running any Exec with this tag. Change-Id: Id9554154320aa7986f66119dac2f1f3174583616 Closes-Bug: #1755102
		
			
				
	
	
		
			42 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Ruby
		
	
	
	
	
	
			
		
		
	
	
			42 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Ruby
		
	
	
	
	
	
require 'spec_helper'
 | 
						|
 | 
						|
describe 'cloudkitty::db::sync' do
 | 
						|
 | 
						|
  shared_examples_for 'cloudkitty-dbsync' do
 | 
						|
 | 
						|
    it 'runs cloudkitty-db-sync' do
 | 
						|
      is_expected.to contain_exec('cloudkitty-db-sync').with(
 | 
						|
        :command     => 'cloudkitty-dbsync upgrade ',
 | 
						|
        :path        => [ '/bin', '/usr/bin', ],
 | 
						|
        :refreshonly => 'true',
 | 
						|
        :user        => 'cloudkitty',
 | 
						|
        :try_sleep   => 5,
 | 
						|
        :tries       => 10,
 | 
						|
        :logoutput   => 'on_failure',
 | 
						|
        :subscribe   => ['Anchor[cloudkitty::install::end]',
 | 
						|
                         'Anchor[cloudkitty::config::end]',
 | 
						|
                         'Anchor[cloudkitty::dbsync::begin]'],
 | 
						|
        :notify      => 'Anchor[cloudkitty::dbsync::end]',
 | 
						|
        :tag         => 'openstack-db',
 | 
						|
      )
 | 
						|
    end
 | 
						|
 | 
						|
  end
 | 
						|
 | 
						|
  on_supported_os({
 | 
						|
    :supported_os   => OSDefaults.get_supported_os
 | 
						|
  }).each do |os,facts|
 | 
						|
    context "on #{os}" do
 | 
						|
      let (:facts) do
 | 
						|
        facts.merge(OSDefaults.get_facts({
 | 
						|
          :os_workers     => 8,
 | 
						|
          :concat_basedir => '/var/lib/puppet/concat'
 | 
						|
        }))
 | 
						|
      end
 | 
						|
 | 
						|
      it_configures 'cloudkitty-dbsync'
 | 
						|
    end
 | 
						|
  end
 | 
						|
 | 
						|
end
 |