diff --git a/manifests/repo/yum.pp b/manifests/repo/yum.pp index 4b2d1abe5f..13d49b46fc 100644 --- a/manifests/repo/yum.pp +++ b/manifests/repo/yum.pp @@ -13,8 +13,8 @@ $url = $sensu::repo_source } else { $url = $sensu::repo ? { - 'unstable' => 'http://repos.sensuapp.org/yum-unstable/el/$releasever/$basearch/', - default => 'http://repos.sensuapp.org/yum/el/$releasever/$basearch/' + 'unstable' => "http://repos.sensuapp.org/yum-unstable/el/${::operatingsystemmajrelease}/\$basearch/", + default => "http://repos.sensuapp.org/yum/el/${::operatingsystemmajrelease}/\$basearch/" } } diff --git a/spec/classes/sensu_package_spec.rb b/spec/classes/sensu_package_spec.rb index 9c1f081244..d6c64006a4 100644 --- a/spec/classes/sensu_package_spec.rb +++ b/spec/classes/sensu_package_spec.rb @@ -85,12 +85,12 @@ end context 'redhat' do - let(:facts) { { :osfamily => 'RedHat' } } + let(:facts) { { :osfamily => 'RedHat', :operatingsystemmajrelease => '6' } } context 'default' do it { should contain_yumrepo('sensu').with( :enabled => 1, - :baseurl => 'http://repos.sensuapp.org/yum/el/$releasever/$basearch/', + :baseurl => 'http://repos.sensuapp.org/yum/el/6/$basearch/', :gpgcheck => 0, :before => 'Package[sensu]' ) } @@ -98,7 +98,7 @@ context 'unstable repo' do let(:params) { { :repo => 'unstable' } } - it { should contain_yumrepo('sensu').with(:baseurl => 'http://repos.sensuapp.org/yum-unstable/el/$releasever/$basearch/' )} + it { should contain_yumrepo('sensu').with(:baseurl => 'http://repos.sensuapp.org/yum-unstable/el/6/$basearch/' )} end context 'override repo url' do