| 1 |
# |
| 2 |
# Copyright (C) 2014 Nine Internet Solutions AG |
| 3 |
# |
| 4 |
# Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 |
# you may not use this file except in compliance with the License. |
| 6 |
# You may obtain a copy of the License at |
| 7 |
# |
| 8 |
# http://www.apache.org/licenses/LICENSE-2.0 |
| 9 |
# |
| 10 |
# Unless required by applicable law or agreed to in writing, software |
| 11 |
# distributed under the License is distributed on an "AS IS" BASIS, |
| 12 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 |
# See the License for the specific language governing permissions and |
| 14 |
# limitations under the License. |
| 15 |
# |
| 16 |
# Author: David Gurtner <[email protected]> |
| 17 |
# |
| 18 |
require 'spec_helper' |
| 19 |
|
| 20 |
describe 'ceph::profile::mon' do |
| 21 |
|
| 22 |
shared_examples 'ceph profile mon' do |
| 23 |
|
| 24 |
it { should contain_ceph__mon('first').with( |
| 25 |
:authentication_type => 'cephx', |
| 26 |
:key => 'AQATGHJTUCBqIBAA7M2yafV1xctn1pgr3GcKPg==', |
| 27 |
:public_addr => '10.11.12.2') |
| 28 |
} |
| 29 |
it { should contain_class('ceph::keys').with( |
| 30 |
'args' => { |
| 31 |
'client.admin' => { |
| 32 |
'secret' => 'AQBMGHJTkC8HKhAAJ7NH255wYypgm1oVuV41MA==', |
| 33 |
'mode' => '0600', |
| 34 |
'cap_mon' => 'allow *', |
| 35 |
'cap_osd' => 'allow *', |
| 36 |
'cap_mds' => 'allow *' |
| 37 |
}, |
| 38 |
'client.bootstrap-osd' => { |
| 39 |
'secret' => 'AQARG3JTsDDEHhAAVinHPiqvJkUi5Mww/URupw==', |
| 40 |
'keyring_path' => '/var/lib/ceph/bootstrap-osd/ceph.keyring', |
| 41 |
'cap_mon' => 'allow profile bootstrap-osd' |
| 42 |
}, |
| 43 |
'client.bootstrap-mds' => { |
| 44 |
'secret' => 'AQCztJdSyNb0NBAASA2yPZPuwXeIQnDJ9O8gVw==', |
| 45 |
'keyring_path' => '/var/lib/ceph/bootstrap-mds/ceph.keyring', |
| 46 |
'cap_mon' => 'allow profile bootstrap-mds' |
| 47 |
}, |
| 48 |
'client.volumes' => { |
| 49 |
'secret' => 'AQA4MPZTOGU0ARAAXH9a0fXxVq0X25n2yPREDw==', |
| 50 |
'mode' => '0644', |
| 51 |
'user' => 'root', |
| 52 |
'group' => 'root', |
| 53 |
'cap_mon' => 'allow r', |
| 54 |
'cap_osd' => 'allow class-read object_prefix rbd_children, allow rwx pool=volumes' |
| 55 |
} |
| 56 |
}, |
| 57 |
'defaults' => { |
| 58 |
'inject' => true, |
| 59 |
'inject_as_id' => 'mon.', |
| 60 |
'inject_keyring' => '/var/lib/ceph/mon/ceph-first/keyring' |
| 61 |
} |
| 62 |
)} |
| 63 |
end |
| 64 |
|
| 65 |
on_supported_os.each do |os, facts| |
| 66 |
context "on #{os}" do |
| 67 |
let(:facts) do |
| 68 |
facts.merge({:hostname => 'first'}) |
| 69 |
end |
| 70 |
|
| 71 |
it_behaves_like 'ceph profile mon' |
| 72 |
end |
| 73 |
end |
| 74 |
end |