Skip to content

Commit

Permalink
Add package_manage and service_manage parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
daaang committed Aug 23, 2024
1 parent 7cd2676 commit 6984c5e
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 39 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ to [Semantic Versioning][2].
[1]: https://keepachangelog.com/en/1.1.0/
[2]: https://semver.org/spec/v2.0.0.html

## [1.0.0](https://github.com/mlibrary/puppet-fwknop/tree/v1.0.0) - 2024-08-22
## [1.0.0](https://github.com/mlibrary/puppet-fwknop/tree/v1.0.0) - 2024-08-23

### Added

- Complete reference documentation
- Complete reference documentation.
- `package_manage` and `service_manage` parameters so this module's
management of the package and service are optional.

## [0.1.0](https://github.com/mlibrary/puppet-fwknop/tree/v0.1.0) - 2024-08-22

Expand Down
8 changes: 8 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,12 @@
# value of 0 is the default verbosity level. Setting it up to 1 or
# higher will allow debugging messages to be displayed.
#
# @param package_manage
# Whether to manage the fwknop-server package. Default true.
#
# @param service_manage
# Whether to manage the fwknop-server service. Default true.
#
class fwknop (
Optional[String] $pcap_intf = undef,
Optional[Boolean] $enable_pcap_promisc = undef,
Expand Down Expand Up @@ -248,6 +254,8 @@
Optional[Boolean] $enable_destination_rule = undef,
Optional[String] $fwknop_run_dir = undef,
Optional[Integer] $verbose = undef,
Boolean $package_manage = true,
Boolean $service_manage = true,
) {
contain fwknop::install
contain fwknop::config
Expand Down
4 changes: 3 additions & 1 deletion manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@
# @api private
#
class fwknop::install {
package { 'fwknop-server': }
if $fwknop::package_manage {
package { 'fwknop-server': }
}
}
4 changes: 3 additions & 1 deletion manifests/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@
# @api private
#
class fwknop::service {
service { 'fwknop-server': }
if $fwknop::service_manage {
service { 'fwknop-server': }
}
}
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mlibrary-fwknop",
"version": "0.1.0",
"version": "1.0.0",
"author": "Regents of the University of Michigan",
"summary": "Install and configure fwknop-server",
"license": "BSD-3-Clause",
Expand Down
14 changes: 14 additions & 0 deletions spec/classes/fwknop_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,20 @@
it { is_expected.to contain_concat__fragment('000 fwknop access header').with_content("# Managed by puppet.\n") }
end

context 'with package_manage set to false' do
let(:params) { { package_manage: false } }

it { is_expected.to compile.with_all_deps }
it { is_expected.not_to contain_package('fwknop-server') }
end

context 'with service_manage set to false' do
let(:params) { { service_manage: false } }

it { is_expected.to compile.with_all_deps }
it { is_expected.not_to contain_service('fwknop-server') }
end

context 'with pcap_intf set to eth5' do
let(:params) { { pcap_intf: 'eth5' } }

Expand Down
17 changes: 0 additions & 17 deletions spec/classes/install_spec.rb

This file was deleted.

17 changes: 0 additions & 17 deletions spec/classes/service_spec.rb

This file was deleted.

0 comments on commit 6984c5e

Please sign in to comment.