Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
Allow partial override about SshServerOptions
Browse files Browse the repository at this point in the history
When operator needs to change any options described in sshd_config,
he/she should use the parameter named SshServerOptions to define
the updated configuration.

However the problem here is that he/she should define the whole content
instead of the actual lines to be overridden, otherwise some of the
lines defined in its default can be missing from configuration. This
makes it difficutlt to properly update the parameter during update or
upgrade, since operators always need to check whetehr any change has
been made about the default of SshServerOptions.

This change introduces a new parameter, SshServerOptionsOverride, which
can be used to override specific line in SshServerOptions. Note that
SshServerOptions should still be used if any of the lines in
SshServerOptions needs to be removed.

Backport Note:
Resolved the conflict caused by sshd-baremetal-ansible.yaml, which
doesn't exist in stable branches.

Change-Id: I8a018c8c7435a753c8ed5b5fa211d91d053f8d67
(cherry picked from commit bfd97da)
  • Loading branch information
kajinamit committed Oct 2, 2020
1 parent 725c09d commit 26298a6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
10 changes: 9 additions & 1 deletion deployment/sshd/sshd-baremetal-puppet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ parameters:
Subsystem: 'sftp /usr/libexec/openssh/sftp-server'
description: Mapping of sshd_config values
type: json
SshServerOptionsOverrides:
default: {}
description: Mapping of sshd_config values to override definitions in
SshServerOptions
type: json
PasswordAuthentication:
default: 'no'
description: Whether or not disable password authentication
Expand All @@ -86,7 +91,10 @@ outputs:
config_settings:
tripleo::profile::base::sshd::bannertext: {get_param: BannerText}
tripleo::profile::base::sshd::motd: {get_param: MessageOfTheDay}
tripleo::profile::base::sshd::options: {get_param: SshServerOptions}
tripleo::profile::base::sshd::options:
map_merge:
- {get_param: SshServerOptions}
- {get_param: SshServerOptionsOverrides}
tripleo::profile::base::sshd::password_authentication: {get_param: PasswordAuthentication}
step_config: |
include tripleo::profile::base::sshd
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
features:
- |
The new ``SshServerOptionsOverrides`` parameter has been added. This
parameter can be used to override a part of sshd_config, which is defined
by the ``SshServerOptions``.

0 comments on commit 26298a6

Please sign in to comment.