diff --git a/manifests/mon.pp b/manifests/mon.pp index 43c35d7e..22c864d7 100644 --- a/manifests/mon.pp +++ b/manifests/mon.pp @@ -85,9 +85,7 @@ define ceph::mon ( status => "service ceph status mon.${id}", } } else { - if ! $public_addr { - fail("operatingsystem = ${::operatingsystem} is not supported") - } + fail("operatingsystem = ${::operatingsystem} is not supported") } $mon_service = "ceph-mon-${id}" diff --git a/spec/classes/ceph_mons_spec.rb b/spec/classes/ceph_mons_spec.rb index a40594ea..fbac98c4 100644 --- a/spec/classes/ceph_mons_spec.rb +++ b/spec/classes/ceph_mons_spec.rb @@ -49,6 +49,7 @@ describe 'ceph::mons' do describe 'Ubuntu' do let :facts do { + :osfamily => 'Debian', :operatingsystem => 'Ubuntu', } end @@ -59,6 +60,7 @@ describe 'ceph::mons' do describe 'Debian' do let :facts do { + :osfamily => 'Debian', :operatingsystem => 'Debian', } end @@ -69,6 +71,7 @@ describe 'ceph::mons' do describe 'RedHat' do let :facts do { + :osfamily => 'RedHat', :operatingsystem => 'RedHat', } end diff --git a/spec/defines/ceph_mon_spec.rb b/spec/defines/ceph_mon_spec.rb index f421a17b..c3817f4a 100644 --- a/spec/defines/ceph_mon_spec.rb +++ b/spec/defines/ceph_mon_spec.rb @@ -28,6 +28,7 @@ describe 'ceph::mon' do let :facts do { + :osfamily => 'Debian', :operatingsystem => 'Ubuntu', } end @@ -61,8 +62,8 @@ touch /etc/ceph/ceph.client.admin.keyring" let :facts do { + :osfamily => 'RedHat', :operatingsystem => 'RHEL6', - :hostname => 'first', } end @@ -78,6 +79,11 @@ touch /etc/ceph/ceph.client.admin.keyring" end it { should contain_service('ceph-mon-A').with('ensure' => "running") } + it { should contain_exec('ceph-mon-ceph.client.admin.keyring-A').with( + 'command' => "/bin/true # comment to satisfy puppet syntax requirements +set -ex +touch /etc/ceph/ceph.client.admin.keyring" + ) } # it { p subject.resources }