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

(MODULES-1019) add capability to configure 'passenv' for individual service #84

Merged
merged 1 commit into from
Oct 2, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions manifests/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
# $log_type - optional
# $bind - optional
# $nice - optional - integer between -20 and 19, inclusive.
# $env - optional
# $passenv - optional
# $redirect - optional - ip or hostname and port of the target service
#
# Actions:
Expand Down Expand Up @@ -92,6 +94,7 @@
$bind = undef,
Optional[Integer[-20, 19]] $nice = undef,
$env = undef,
$passenv = undef,
$redirect = undef,
) {

Expand Down Expand Up @@ -148,6 +151,8 @@
# - $access_types
# - $log_type
# - $nice
# - $env
# - $passenv
# - $redirect
file { "${xinetd::confdir}/${title}":
ensure => $ensure,
Expand Down
5 changes: 2 additions & 3 deletions spec/classes/xinetd_init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
:mdns => 'yes',
:v6only => 'no',
:env => 'foo=bar',
:passenv => 'yes',
:passenv => 'PATH',
:groups => 'yes',
:umask => '002',
:banner => '/etc/banner',
Expand All @@ -82,8 +82,7 @@
should contain_file('/etc/xinetd.conf').with_content(/mdns *= yes/)
should contain_file('/etc/xinetd.conf').with_content(/v6only *= no/)
should contain_file('/etc/xinetd.conf').with_content(/env *= foo=bar/)
should contain_file('/etc/xinetd.conf').with_content(/passenv *= yes/)
should contain_file('/etc/xinetd.conf').with_content(/passenv *= yes/)
should contain_file('/etc/xinetd.conf').with_content(/passenv *= PATH/)
should contain_file('/etc/xinetd.conf').with_content(/groups *= yes/)
should contain_file('/etc/xinetd.conf').with_content(/umask *= 002/)
should contain_file('/etc/xinetd.conf').with_content(/banner *= \/etc\/banner/)
Expand Down
3 changes: 3 additions & 0 deletions templates/service.erb
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ service <%= @service_name %>
<% if @env -%>
env = <%= @env %>
<% end -%>
<% if @passenv -%>
passenv = <%= @passenv %>
<% end -%>
<% if @instances -%>
instances = <%= @instances %>
<% end -%>
Expand Down