Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add service control and package ensure parameters #204

Merged
merged 5 commits into from
Aug 28, 2019
Merged

Add service control and package ensure parameters #204

merged 5 commits into from
Aug 28, 2019

Conversation

cohoe
Copy link
Contributor

@cohoe cohoe commented Aug 23, 2019

This PR adds parameters for $service_enable and $service_ensure to the module. There are cases where I need the ability to stop/disable unbound.

Update: also adds parameter for $package_ensure to enable the ability to pin a specific version (default is installed aka present which maintains compatibility.

The Enum[] for service_ensure was lifted from puppetlabs-ntp. Per the Puppet Docs (4.6 to latest) this should be able to accept values of stopped, running, false, or true. However the Enum Data Type can only match strings, thus rendering the boolean values unavailable. Given the Puppetlabs reference module has this behavior as well, I suspect this will not be a problem for the majority of users who elect to use this parameter here.

@cohoe
Copy link
Contributor Author

cohoe commented Aug 23, 2019

Tests failed due to what I believe are unrelated OpenBSD configurations.

  1) unbound on openbsd-5.9-amd64 with default params should contain Package[unbound]
     Failure/Error: it { is_expected.to contain_package(package) }
       expected that the catalogue would contain Package[unbound]

Package name is set to emptystring which prevents the package{} resource from being declared in the catalog.

2) unbound on openbsd-5.9-amd64 with default params should contain Concat::Fragment[unbound-header] with content =~ /\s+root-hints:\s"\/var\/unbound\/etc\/root.hints"/, content =~ ........
     Failure/Error:
       is_expected.to contain_concat__fragment(
         'unbound-header'
       ).with_content(........
       expected that the catalogue would contain Concat::Fragment[unbound-header] with content set to /\s+pidfile:\s"\/var\/run\/unbound\/unbound.pid"/ but it is set to "# Managed by Puppet\n#......

pidfile is set to /var/run/unbound.pid in hiera but /var/run/unbound/unbound.pid in test. I do not operate any OpenBSD systems so I do not know which one is appropriate.

@zachfi
Copy link
Contributor

zachfi commented Aug 23, 2019

Thank you for the PR. I can take a look at the OpenBSD issue over the weekend and come back to this.

@cohoe cohoe changed the title Add service control parameters Add service control and package ensure parameters Aug 26, 2019
@zachfi
Copy link
Contributor

zachfi commented Aug 26, 2019

I started testing here, corrected the pid path, but the package is now in my way. I just need a quick solution in the tests to skip the package test on openbsd and this will be looking good.

@zachfi zachfi merged commit 03c86ae into voxpupuli:master Aug 28, 2019
@zachfi
Copy link
Contributor

zachfi commented Aug 28, 2019

I've corrected the OpenBSD tests. Thank you for the PR.

@cohoe cohoe deleted the cohoe-service branch August 28, 2019 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants