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

Make server parameter optional and allow service definition without explicit group #101

Merged
merged 3 commits into from Oct 3, 2017

Conversation

eputnam
Copy link
Contributor

@eputnam eputnam commented Oct 2, 2017

According to the documentation, the server parameter is optional if a
redirection is configured. This patch makes the server parameter
optional. It includes a check to make sure at least one of the
parameters is defined. The manpage xinetd.conf(5) defines the precedence
rule if both parameters are defined, so that is not an error.

The group setting may be omitted in a service configuration to use the users primary group. This config is currently not possible because setting the group parameter to undef will use the os specific default group instead. This patch adds an additional parameter use_default_group to control this behaviour. Using the default true keeps the old behaviour. Setting the parameter to false and leaving the group unset will omit the group setting from the service config file.

closes #77 and #78

@eputnam eputnam force-pushed the feature-optional-server-param branch from 171d9cd to 4f29a2b Compare October 2, 2017 18:11
@eputnam eputnam changed the title Make server parameter optional when redirect is set Make server parameter optional and allow service definition without explicit group Oct 2, 2017
if $user {
$_user = $user
} else {
$_user = $xinetd::params::default_user
}

if $group {
if $group or bool2num($use_default_group) == 0 {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this be equal to if $group or !use_default_group {?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, yep, good call.

smoeding and others added 3 commits October 3, 2017 13:20
The group setting may be omitted in a service configuration to use the
users primary group. This config is currently not possible because
setting the group parameter to 'undef' will use the os specific default
group instead. This patch adds an additional parameter
'use_default_group' to control this behaviour. Using the default 'true'
keeps the old behaviour. Setting the parameter to 'false' and leaving
the group unset will omit the group setting from the service config
file.
According to the documentation, the server parameter is optional if a
redirection is configured. This patch makes the server parameter
optional. It includes a check to make sure at least one of the
parameters is defined. The manpage xinetd.conf(5) defines the precedence
rule if both parameters are defined, so that is not an error.
There's an unnecessary bool2num in service.pp that can be converted to
simply check for not true.
@eputnam eputnam force-pushed the feature-optional-server-param branch from 3065087 to d9993ed Compare October 3, 2017 20:22
@HAIL9000 HAIL9000 merged commit 1b9efad into puppetlabs:master Oct 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants