Skip to content

Parameterize mode of private key. #410

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,7 @@ The following parameters are available in the `ssh::server` class:
* [`sshd_binary`](#-ssh--server--sshd_binary)
* [`sshd_config_mode`](#-ssh--server--sshd_config_mode)
* [`host_priv_key_group`](#-ssh--server--host_priv_key_group)
* [`host_priv_key_mode`](#-ssh--server--host_priv_key_mode)
* [`default_options`](#-ssh--server--default_options)
* [`ensure`](#-ssh--server--ensure)
* [`include_dir`](#-ssh--server--include_dir)
Expand Down Expand Up @@ -592,6 +593,12 @@ Data type: `Integer`

Name of the group for the private host key

##### <a name="-ssh--server--host_priv_key_mode"></a>`host_priv_key_mode`

Data type: `Stdlib::Filemode`

Mode of the private host key

##### <a name="-ssh--server--default_options"></a>`default_options`

Data type: `Hash`
Expand Down
1 change: 1 addition & 0 deletions data/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ ssh::client::ssh_config: '/etc/ssh/ssh_config'
ssh::server::service_name: 'svc:/network/ssh:default'
ssh::sftp_server_path: 'internal-sftp'
ssh::server::host_priv_key_group: 0
ssh::server::host_priv_key_mode: '0600'
ssh::validate_sshd_file : false
ssh::collect_enabled : true # Collect sshkey resources
ssh::server::issue_net : '/etc/issue.net'
Expand Down
4 changes: 4 additions & 0 deletions manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
# @param host_priv_key_group
# Name of the group for the private host key
#
# @param host_priv_key_mode
# Mode of the private host key
#
# @param default_options
# Default options to set, will be merged with options parameter
#
Expand Down Expand Up @@ -78,6 +81,7 @@
Stdlib::Absolutepath $sshd_binary,
Stdlib::Filemode $sshd_config_mode,
Integer $host_priv_key_group,
Stdlib::Filemode $host_priv_key_mode,
Hash $default_options,
Enum[present,absent,latest] $ensure = present,
Optional[Stdlib::Absolutepath] $include_dir = undef,
Expand Down
4 changes: 2 additions & 2 deletions manifests/server/host_key.pp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
ensure => $ensure,
owner => 0,
group => $ssh::server::host_priv_key_group,
mode => '0600',
mode => $ssh::server::host_priv_key_mode,
path => "${ssh::server::sshd_dir}/${name}",
source => $manage_priv_key_source,
content => $manage_priv_key_content,
Expand All @@ -121,7 +121,7 @@
ensure => $ensure,
owner => 0,
group => $ssh::server::host_priv_key_group,
mode => '0600',
mode => $ssh::server::host_priv_key_mode,
path => "${ssh::server::sshd_dir}/${name}",
show_diff => false,
notify => Class['ssh::server::service'],
Expand Down