-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Joshua Hoblitt
committed
Aug 30, 2013
1 parent
8b01bd9
commit da6d309
Showing
7 changed files
with
96 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# == Class: policykit::params | ||
# | ||
# This class should be considered private. | ||
# | ||
# === Authors | ||
# | ||
# Joshua Hoblitt <[email protected]> | ||
# | ||
# === Copyright | ||
# | ||
# Copyright (C) 2013 Joshua Hoblitt | ||
# | ||
class policykit::params { | ||
|
||
case $::osfamily { | ||
'redhat': { | ||
case $::lsbmajdistrelease { | ||
6: { | ||
$policykit_package = 'policykit-1' | ||
$policykit_local_path = '/etc/polkit-1/localauthority/50-local.d' | ||
} | ||
default: { | ||
fail("Module ${module_name} is not supported on lsbmajdistrelease ${::lsbmajdistrelease}") | ||
} | ||
} | ||
} | ||
default: { | ||
fail("Module ${module_name} is not supported on ${::operatingsystem}") | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
require 'spec_helper' | ||
|
||
describe 'policykit::params', :type => :class do | ||
describe 'for osfamily RedHat' do | ||
let :facts do | ||
{ | ||
:osfamily => 'RedHat', | ||
} | ||
end | ||
|
||
describe 'el6.x' do | ||
before { facts[:lsbmajdistrelease] = '6' } | ||
|
||
it { should include_class('policykit::params') } | ||
end | ||
|
||
describe 'unsupported lsbmajdistrelease' do | ||
before { facts[:lsbmajdistrelease] = '7' } | ||
|
||
it 'should fail' do | ||
expect { should include_class('policykit::params') }. | ||
to raise_error(Puppet::Error, /not supported on lsbmajdistrelease 7/) | ||
end | ||
end | ||
end | ||
|
||
describe 'unsupported osfamily' do | ||
let :facts do | ||
{ | ||
:osfamily => 'Debian', | ||
:operatingsystem => 'Debian', | ||
} | ||
end | ||
|
||
it 'should fail' do | ||
expect { should include_class('policykit::params') }. | ||
to raise_error(Puppet::Error, /not supported on Debian/) | ||
end | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters