-
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
Jan 16, 2014
1 parent
2374d20
commit e984464
Showing
7 changed files
with
106 additions
and
12 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,15 @@ | ||
# private class | ||
class port389::install ( | ||
$package_ensure = $port389::package_ensure, | ||
$package_name = $port389::package_name, | ||
) { | ||
if $caller_module_name != $module_name { | ||
fail("Use of private class ${name} by ${caller_module_name}") | ||
} | ||
|
||
ensure_packages(any2array($package_ensure)) | ||
|
||
package { $package_name: | ||
ensure => present, | ||
} | ||
} |
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,34 @@ | ||
# private class | ||
class port389::params { | ||
case $::osfamily { | ||
'redhat': {} | ||
default: { | ||
fail("Module ${module_name} is not supported on ${::operatingsystem}") | ||
} | ||
} | ||
|
||
# console also requires java | ||
$package_name = [ | ||
'389-admin', | ||
'389-admin-console', | ||
'389-admin-console-doc', | ||
#'389-admin-debuginfo', | ||
'389-adminutil', | ||
#'389-adminutil-debuginfo', | ||
'389-adminutil-devel', | ||
'389-console', | ||
'389-ds', | ||
'389-ds-base', | ||
'389-ds-base-devel', | ||
'389-ds-base-libs', | ||
'389-ds-console', | ||
'389-ds-console-doc', | ||
'389-dsgw', | ||
#'389-dsgw-debuginfo', | ||
] | ||
|
||
# console requires /usr/sbin/httpd.worker provided by `httpd` | ||
# we need to ensure the presence of this package but do not want 'ownership' | ||
# of it | ||
$package_ensure = 'httpd' | ||
} |
This file was deleted.
Oops, something went wrong.
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,42 @@ | ||
require 'spec_helper' | ||
|
||
describe 'port389', :type => :class do | ||
|
||
describe 'on osfamily RedHat' do | ||
let(:facts) {{ :osfamily => 'RedHat' }} | ||
|
||
it('should import') { should contain_class('port389') } | ||
|
||
it('should include package dependency') { should contain_package('httpd') } | ||
[ | ||
'389-admin', | ||
'389-admin-console', | ||
'389-admin-console-doc', | ||
#'389-admin-debuginfo', | ||
'389-adminutil', | ||
#'389-adminutil-debuginfo', | ||
'389-adminutil-devel', | ||
'389-console', | ||
'389-ds', | ||
'389-ds-base', | ||
'389-ds-base-devel', | ||
'389-ds-base-libs', | ||
'389-ds-console', | ||
'389-ds-console-doc', | ||
'389-dsgw', | ||
#'389-dsgw-debuginfo', | ||
].each do |pkg| | ||
it('should include package') { should contain_package(pkg) } | ||
end | ||
end # on osfamily RedHat | ||
|
||
describe 'on an unsupported osfamily' do | ||
let(:facts) {{ :osfamily => 'Debian', :operatingsystem => 'Debian' }} | ||
|
||
it 'should fail' do | ||
expect { should contain_class('port389') }. | ||
to raise_error(Puppet::Error, /not supported on Debian/) | ||
end | ||
end # on an unsupported osfamily | ||
|
||
end |