Skip to content

Commit

Permalink
Merge pull request #374 from dbeckham/fix_os_name_fact_issue
Browse files Browse the repository at this point in the history
Fix OS facts usage when selecting repo class for Ubuntu systems
  • Loading branch information
alexjfisher authored Aug 11, 2017
2 parents dd43189 + 3c598fb commit ee5534e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion manifests/repo.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
case $facts['os']['family'] {
'Debian': {
# no contain here because apt does that already
case $facts['os']['family'] {
case $facts['os']['name'] {
'Debian': {
include ::php::repo::debian
}
Expand Down
27 changes: 27 additions & 0 deletions spec/classes/php_repo_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
require 'spec_helper'

describe 'php::repo', type: :class do
on_supported_os.each do |os, facts|
context "on #{os}" do
let :facts do
facts
end

describe 'when configuring a package repo' do
case facts[:osfamily]
when 'Debian'
case facts[:operatingsystem]
when 'Debian'
it { is_expected.to contain_class('php::repo::debian') }
when 'Ubuntu'
it { is_expected.to contain_class('php::repo::ubuntu') }
end
when 'Suse'
it { is_expected.to contain_class('php::repo::suse') }
when 'RedHat'
it { is_expected.to contain_class('php::repo::redhat') }
end
end
end
end
end

0 comments on commit ee5534e

Please sign in to comment.