Skip to content

Commit

Permalink
Fleshed out the unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wwkimball committed Sep 18, 2017
1 parent 026b3a2 commit c32f6ab
Show file tree
Hide file tree
Showing 10 changed files with 435 additions and 34 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@
/Gemfile.lock
/junit/
/log/
/log/
/pkg/
/spec/fixtures/manifests/
/spec/fixtures/modules/
/tmp/
/vendor/

2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ group :development do
gem "puppet-module-win-default-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "puppet-module-win-dev-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "puppet-strings", '1.1.0', require: false, platforms: [:ruby]
gem "rspec-puppet-yaml", '0.1.0', require: false, platforms: [:ruby]
gem "rspec-puppet-yaml", '0.1.1', require: false, platforms: [:ruby]
end

puppet_version = ENV['PUPPET_GEM_VERSION']
Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@

### Foreword

The author of this module has long promoted a line of thinking that builds off of **Infrastructure As Code** into **Infrastructure As Data**. With Hiera and modules like this, you can express your entire enterprise infrastructure purely as data without any more code for you to write or manage (not even antiquated roles/profiles). As such, all examples in this document and the module's in-file documentation are presented strictly as YAML.
The original author of this module has long promoted a line of thinking that
builds off of **Infrastructure As Code** into **Infrastructure As Data**. With
Hiera and modules like this, end-users can simply import the code they need and
then fully express their entire enterprise infrastructure purely as data without
any more code to write or support (not even antiquated roles/profiles). As
such, all examples in this document and the module's in-file documentation are
presented strictly as YAML.

#### Table of Contents

Expand Down Expand Up @@ -60,7 +66,7 @@ Many usage examples are provided via the source code documentation. Refer to th

## Reference

This module is extensively documented via [Puppet Strings](https://github.com/puppetlabs/puppet-strings). Pre-generated, web-accessible reference documentation can be found at [GitHub Pages for this project](https://wwkimball.github.io/wwkimball-postfix/docs/puppet_classes/postfix.html).
This module is extensively documented via [Puppet Strings](https://github.com/puppetlabs/puppet-strings). Pre-generated, web-accessible reference documentation can be found at [GitHub Pages for this project](https://wwkimball.github.io/wwkimball-postfix/docs/puppet_classes/postfix.html) whenever the Travis CI 'provider: pages' feature actually works (it is specifically cited as "experimental"). When the URL is dead, please just run `bundle install && bundle exec rake strings:generate` from this module's top directory to have a local copy of the documentation generated for you in the [docs](docs/index.html) directory (which is deliberately *not* committed to Git).

## Limitations

Expand Down
2 changes: 1 addition & 1 deletion data/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,4 @@ postfix::global_parameters:
setgid_group: postdrop
manpage_directory: /usr/share/man

# vim: tabstop=2:softtabstop=2:shiftwidth=2:expandtab:ai
# vim: syntax=yaml:tabstop=2:softtabstop=2:shiftwidth=2:expandtab:ai
19 changes: 11 additions & 8 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,14 @@
# &nbsp; ...<br>
# Default is found in the data directory of this module's source and is applied
# per this module's hiera.yaml.
# @param config_hash_key_knockout_prefix String of characters which, when
# @param config_hash_key_knockout_prefix String of `-` characters which, when
# present as a prefix to any supporting Hash key, will cause that entire key
# and its value to be removed from the resulting rendered configuration file.
# Default is found in the data directory of this module's source and is applied
# per this module's hiera.yaml.
# This is limited to one or more hyphen (`-`) characters because the matching
# patterns for the keys users would likely must assume a pre-known value for
# this parameter and one or more hyphens seems most reasonable. Default is
# found in the data directory of this module's source and is applied per this
# module's hiera.yaml.
# @param global_parameters Full content of main.cf as a Hash with structure:<br>
# &nbsp; KEY: VALUE<br>
# &nbsp; ...<br>
Expand Down Expand Up @@ -96,13 +99,13 @@
Hash[String[4], Any] $config_file_attributes,
String[3] $config_file_path,
Hash[String[4], Any] $config_file_path_attributes,
String $config_hash_key_knockout_prefix,
Pattern[/^-+$/] $config_hash_key_knockout_prefix,
Hash[
Pattern[/^[A-Za-z0-9_]+$/],
Pattern[/^-*[A-Za-z0-9_]+$/],
Variant[String, Integer]
] $global_parameters,
Hash[
Pattern[/^[a-z]+\/(inet|unix|fifo|pass)$/],
Pattern[/^-*[a-z]+\/(inet|unix|fifo|pass)$/],
Struct[{
command => String[2],
Optional['private'] => Enum['y', 'n'],
Expand All @@ -115,7 +118,7 @@
String[2] $package_name,
Boolean $purge_config_file_path,
Boolean $service_enable,
Enum[running, stopped] $service_ensure,
Enum['running', 'stopped'] $service_ensure,
Boolean $service_managed,
String[2] $service_name,
Optional[Hash[
Expand All @@ -125,7 +128,7 @@
Optional[Hash[
String[2],
Hash[
Pattern[/^[A-Za-z0-9_]+$/],
Pattern[/^-*[A-Za-z0-9_]+$/],
Any
]]] $config_files = undef,
) {
Expand Down
Loading

0 comments on commit c32f6ab

Please sign in to comment.