forked from cernops/puppet-module-autofs
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from rehanone/develop/puppet4-data-types
- Added Puppet 4 types for all parameters.
- Loading branch information
Showing
13 changed files
with
253 additions
and
214 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
# | ||
class autofs::config inherits autofs { | ||
|
||
autofs::mapfile { $autofs::master_config: | ||
directory => undef, | ||
} | ||
|
||
create_resources('autofs::includes', $autofs::includes) | ||
create_resources('autofs::include', $autofs::includes) | ||
create_resources('autofs::mapfile', $autofs::mapfiles) | ||
create_resources('autofs::mount', $autofs::mounts) | ||
} | ||
} |
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 |
---|---|---|
@@ -1,16 +1,17 @@ | ||
define autofs::include( | ||
$mapfile = $name, | ||
$order = undef | ||
# | ||
define autofs::include ( | ||
String $mapfile = $title, | ||
Optional[String] $order = undef | ||
) { | ||
include ::autofs | ||
|
||
if $mapfile == $autofs::master_config { | ||
fail("${autofs::mapfile_config_dir}/${autofs::master_config} can't include itself!") | ||
fail("${autofs::map_config_dir}/${autofs::master_config} can't include itself!") | ||
} | ||
|
||
concat::fragment { "${autofs::master_config}/${mapfile}": | ||
target => $autofs::master_config, | ||
content => "+${mapfile}", | ||
order => $order; | ||
} | ||
} | ||
} |
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 |
---|---|---|
|
@@ -6,4 +6,4 @@ | |
ensure => $autofs::package_ensure, | ||
} | ||
} | ||
} | ||
} |
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
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 |
---|---|---|
@@ -1,25 +1,32 @@ | ||
require 'spec_helper' | ||
|
||
describe 'autofs::include' do | ||
let(:title) { 'auto.include' } | ||
let(:facts) { { osfamily: 'RedHat', concat_basedir: '/mock_dir' } } | ||
on_supported_os.each do |os, facts| | ||
context "on #{os}" do | ||
let(:facts) do | ||
facts | ||
end | ||
|
||
describe 'testing class' do | ||
it { is_expected.not_to raise_error } | ||
it do | ||
is_expected.to contain_concat__fragment('auto.master/auto.include') | ||
.with_content(%r{\+auto\.include}) | ||
end | ||
end | ||
let(:title) { 'auto.include' } | ||
|
||
describe 'testing class' do | ||
it { is_expected.not_to raise_error } | ||
it do | ||
is_expected.to contain_concat__fragment('auto.master/auto.include') | ||
.with_content(%r{\+auto\.include}) | ||
end | ||
end | ||
|
||
describe 'testing all parameters' do | ||
let(:params) { { mapfile: 'auto.foo', order: '5' } } | ||
describe 'testing all parameters' do | ||
let(:params) { { mapfile: 'auto.foo', order: '5' } } | ||
|
||
it { is_expected.not_to raise_error } | ||
it do | ||
is_expected.to contain_concat__fragment('auto.master/auto.foo') | ||
.with_content(%r{\+auto\.foo}) | ||
.with_order('5') | ||
it { is_expected.not_to raise_error } | ||
it do | ||
is_expected.to contain_concat__fragment('auto.master/auto.foo') | ||
.with_content(%r{\+auto\.foo}) | ||
.with_order('5') | ||
end | ||
end | ||
end | ||
end | ||
end |
Oops, something went wrong.