Fix to allow for arbitrary interface naming

Previously facter parameters ipaddress_eth0 and ipaddress_eth1 were
hardcoded at various places in the tests. RHEL 7, CentOS 7, Fedora 21
and similar are using systemd's predictable naming instead which in
vagrant/virtualbox leads to things like ipaddress_enp0s3 or
ipaddress_enp0s8 instead and consequently breaks testing on those
systems.

Change-Id: I0a045c673e218d6a611dc9f4e2f187b7e33eb143
This commit is contained in:
David Gurtner 2015-02-18 22:23:44 +01:00
parent 35965caf07
commit cbf70f6008
13 changed files with 23 additions and 24 deletions

View File

@ -15,7 +15,7 @@ I want to run it on a virtual machine, all in one. The **ceph::repo** class will
class { 'ceph::repo': }
class { 'ceph':
fsid => generate('/usr/bin/uuidgen'),
mon_host => $::ipaddress_eth0,
mon_host => $::ipaddress,
authentication_type => 'none',
osd_pool_default_size => '1',
osd_pool_default_min_size => '1',
@ -24,7 +24,7 @@ I want to run it on a virtual machine, all in one. The **ceph::repo** class will
'global/osd_journal_size': value => '100';
}
ceph::mon { 'a':
public_addr => $::ipaddress_eth0,
public_addr => $::ipaddress,
authentication_type => 'none',
}
ceph::osd { '/srv/data': }
@ -61,7 +61,6 @@ Enjoy your ceph cluster!
mon_host => '<ip of mon1>,<ip of mon2>,<ip of mon3>',
}
ceph::mon { $::hostname:
public_addr => $::ipaddress_eth0,
key => $mon_key,
}
Ceph::Key {
@ -141,7 +140,6 @@ On the client:
authentication_type => 'none',
}
ceph::mon { $::hostname:
public_addr => $::ipaddress_eth0,
authentication_type => 'none',
}
ceph::osd {

View File

@ -29,7 +29,7 @@ describe 'ceph usecases' do
class { 'ceph::repo': }
class { 'ceph':
fsid => generate('/usr/bin/uuidgen'),
mon_host => $::ipaddress_eth0,
mon_host => $::ipaddress,
authentication_type => 'none',
osd_pool_default_size => '1',
osd_pool_default_min_size => '1',
@ -38,7 +38,7 @@ describe 'ceph usecases' do
'global/osd_journal_size': value => '100';
}
ceph::mon { 'a':
public_addr => $::ipaddress_eth0,
public_addr => $::ipaddress,
authentication_type => 'none',
}
ceph::osd { '/srv/data': }

View File

@ -2,7 +2,7 @@
#################
# Data Mappings #
#################
ceph::mons::defaults:
authentication_type: cephx
key: "%{hiera('mon_key')}"

View File

@ -2,6 +2,7 @@
release: firefly
fsid: '4b5c8c0a-ff60-454b-a1b4-9747aa737d19'
mon_host: '10.11.12.2, 10.11.12.3'
mon_initial_members: 'first,second'
public_network: '10.11.12.0/24'
# Global Hiera Params:
@ -18,11 +19,12 @@ ceph::fsid: "%{hiera('fsid')}"
ceph::mon_host: "%{hiera('mon_host')}"
ceph::mon_initial_members: "%{hiera('mon_initial_members')}"
ceph::public_network: "%{hiera('public_network')}"
ceph::mons::args:
"%{hostname}":
public_addr: "%{::ipaddress_eth1}"
"%{hostname}": {}
ceph::mons::defaults:
authentication_type: none

View File

@ -1 +1,2 @@
mon_host: '10.11.12.2'
mon_initial_members: 'first'

View File

@ -1,4 +1,3 @@
# %{ipaddress_eth1} is not substituted within hash (it is a scenario_mode_terminus limitation)
---
ceph::mons::args:
'first':

View File

@ -1,4 +1,3 @@
# %{ipaddress_eth1} is not substituted within hash (it is a scenario_mode_terminus limitation)
---
ceph::mons::args:
'second':

View File

@ -30,7 +30,7 @@ describe 'ceph::key' do
mon_key = 'AQCztJdSyNb0NBAASA2yPZPuwXeIQnDJ9O8gVw=='
admin_key = 'AQA0TVRTsP/aHxAAFBvntu1dSEJHxtJeFFrRsg==' # client.admin key needs to contain a / character!
volume_key = 'AQAMTVRTSOHmHBAAH5d1ukHrAnxuSbrWSv9KGA=='
mon_host = '$::ipaddress_eth1'
mon_host = '$::ipaddress'
# passing it directly as unqoted array is not supported everywhere
packages = "[ 'python-ceph', 'ceph-common', 'librados2', 'librbd1', 'libcephfs1' ]"

View File

@ -24,7 +24,7 @@ describe 'ceph::mon' do
releases = ENV['RELEASES'] ? ENV['RELEASES'].split : [ 'dumpling', 'firefly', 'giant' ]
machines = ENV['MACHINES'] ? ENV['MACHINES'].split : [ 'first', 'second' ]
fsid = 'a4807c9a-e76f-4666-a297-6d6cbc922e3a'
mon_host = '$::ipaddress_eth1'
mon_host = '$::ipaddress'
# passing it directly as unqoted array is not supported everywhere
packages = "[ 'python-ceph', 'ceph-common', 'librados2', 'librbd1', 'libcephfs1' ]"
@ -252,11 +252,11 @@ describe 'ceph::mon' do
class { 'ceph':
fsid => '#{fsid}',
mon_host => '10.11.12.2,10.11.12.3',
mon_initial_members => 'first,second',
public_network => '10.11.12.0/24',
authentication_type => 'none',
}
ceph::mon { '#{mon}':
public_addr => $::ipaddress_eth1,
authentication_type => 'none',
}
EOS

View File

@ -26,7 +26,7 @@ describe 'ceph::osd' do
machines = ENV['MACHINES'] ? ENV['MACHINES'].split : [ 'first', 'second' ]
fsid = 'a4807c9a-e76f-4666-a297-6d6cbc922e3a'
admin_key = 'AQA0TVRTsP/aHxAAFBvntu1dSEJHxtJeFFrRsg=='
mon_host = '$::ipaddress_eth1'
mon_host = '$::ipaddress'
# passing it directly as unqoted array is not supported everywhere
packages = "[ 'python-ceph', 'ceph-common', 'librados2', 'librbd1', 'libcephfs1' ]"

View File

@ -23,6 +23,7 @@ describe 'ceph::pool' do
releases = ENV['RELEASES'] ? ENV['RELEASES'].split : [ 'dumpling', 'firefly', 'giant' ]
fsid = 'a4807c9a-e76f-4666-a297-6d6cbc922e3a'
mon_host = '$::ipaddress'
# passing it directly as unqoted array is not supported everywhere
packages = "[ 'python-ceph', 'ceph-common', 'librados2', 'librbd1', 'libcephfs1' ]"
@ -35,11 +36,11 @@ describe 'ceph::pool' do
}
class { 'ceph':
fsid => '#{fsid}',
mon_host => $::ipaddress_eth0,
mon_host => #{mon_host},
authentication_type => 'none',
}
ceph::mon { 'a':
public_addr => $::ipaddress_eth0,
public_addr => #{mon_host},
authentication_type => 'none',
}
EOS

View File

@ -25,6 +25,7 @@ describe 'ceph::rgw::apache' do
mon_key ='AQCztJdSyNb0NBAASA2yPZPuwXeIQnDJ9O8gVw=='
admin_key = 'AQA0TVRTsP/aHxAAFBvntu1dSEJHxtJeFFrRsg=='
radosgw_key = 'AQA0TVRTsP/aHxAAFBvntu1dSEJHxtJeFFrRwg=='
mon_host = '$::ipaddress'
# passing it directly as unqoted array is not supported everywhere
packages = "[ 'python-ceph', 'ceph-common', 'librados2', 'librbd1', 'libcephfs1' ]"
@ -44,12 +45,12 @@ describe 'ceph::rgw::apache' do
}
class { 'ceph':
fsid => '#{fsid}',
mon_host => $::ipaddress_eth0,
mon_host => #{mon_host},
osd_pool_default_size => '1',
osd_pool_default_min_size => '1',
}
ceph::mon { 'a':
public_addr => $::ipaddress_eth0,
public_addr => #{mon_host},
key => '#{mon_key}',
}
ceph::key { 'client.admin':
@ -77,7 +78,7 @@ describe 'ceph::rgw::apache' do
ceph::osd { '/dev/sdb': }
host { $::fqdn: # workaround for bad 'hostname -f' in vagrant box
ip => $ipaddress,
ip => #{mon_host},
}
->
file { '/var/run/ceph': # workaround for bad sysvinit script (ignores socket)

View File

@ -31,7 +31,7 @@ describe 'ceph usecases' do
class { 'ceph::repo': }
class { 'ceph':
fsid => generate('/usr/bin/uuidgen'),
mon_host => $::ipaddress_eth0,
mon_host => $::ipaddress,
authentication_type => 'none',
osd_pool_default_size => '1',
osd_pool_default_min_size => '1',
@ -40,7 +40,7 @@ describe 'ceph usecases' do
'global/osd_journal_size': value => '100';
}
ceph::mon { 'a':
public_addr => $::ipaddress_eth0,
public_addr => $::ipaddress,
authentication_type => 'none',
}
ceph::osd { '/srv/data': }
@ -154,7 +154,6 @@ describe 'ceph usecases' do
mon_host => '10.11.12.2',
}
ceph::mon { $::hostname:
public_addr => $::ipaddress_eth1, # we only know the IP on eth1
key => $mon_key,
}
Ceph::Key {
@ -298,7 +297,6 @@ describe 'ceph usecases' do
authentication_type => 'none',
}
ceph::mon { $::hostname:
public_addr => $::ipaddress_eth1, # we only know the IP on eth1
authentication_type => 'none',
}
ceph::osd { '/dev/sdb': }