Skip to content

Commit 4fe6f25

Browse files
author
Daniel Henninger
committed
Streamling the package options.
1 parent f903d54 commit 4fe6f25

File tree

4 files changed

+31
-52
lines changed

4 files changed

+31
-52
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,3 +383,6 @@ It is based on the following project: <https://github.com/PowerShell/openssh-por
383383

384384
This product is installed via Chocolatey and the package definition
385385
can be found here: <https://chocolatey.org/packages/openssh>
386+
387+
SSHD server support is assumed, so this module installs the server features regardless
388+
of whether you intend to only use the client.

manifests/client/install.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
ensure_packages([$ssh::params::client_package_name], {
44
'ensure' => $ssh::client::ensure,
55
'provider' => $ssh::params::package_provider,
6-
'install_options' => $ssh::params::client_package_install_options,
7-
'uninstall_options' => $ssh::params::client_package_uninstall_options,
6+
'install_options' => $ssh::params::package_install_options,
7+
'uninstall_options' => $ssh::params::package_uninstall_options,
88
})
99
}
1010
}

manifests/params.pp

Lines changed: 24 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22
case $::osfamily {
33
'Debian': {
44
$server_package_name = 'openssh-server'
5-
$server_package_install_options = undef
6-
$server_package_uninstall_options = undef
5+
$package_install_options = undef
6+
$package_uninstall_options = undef
77
$client_package_name = 'openssh-client'
8-
$client_package_install_options = undef
9-
$client_package_uninstall_options = undef
108
$package_provider = undef
119
$home_dir_path = '/home'
1210
$sshd_path = '/usr/sbin/sshd'
@@ -28,11 +26,9 @@
2826
}
2927
'RedHat': {
3028
$server_package_name = 'openssh-server'
31-
$server_package_install_options = undef
32-
$server_package_uninstall_options = undef
29+
$package_install_options = undef
30+
$package_uninstall_options = undef
3331
$client_package_name = 'openssh-clients'
34-
$client_package_install_options = undef
35-
$client_package_uninstall_options = undef
3632
$package_provider = undef
3733
$home_dir_path = '/home'
3834
$sshd_path = '/usr/sbin/sshd'
@@ -58,11 +54,9 @@
5854
}
5955
'FreeBSD', 'DragonFly': {
6056
$server_package_name = undef
61-
$server_package_install_options = undef
62-
$server_package_uninstall_options = undef
57+
$package_install_options = undef
58+
$package_uninstall_options = undef
6359
$client_package_name = undef
64-
$client_package_install_options = undef
65-
$client_package_uninstall_options = undef
6660
$package_provider = undef
6761
$home_dir_path = '/home'
6862
$sshd_path = '/usr/sbin/sshd'
@@ -84,11 +78,9 @@
8478
}
8579
'OpenBSD': {
8680
$server_package_name = undef
87-
$server_package_install_options = undef
88-
$server_package_uninstall_options = undef
81+
$package_install_options = undef
82+
$package_uninstall_options = undef
8983
$client_package_name = undef
90-
$client_package_install_options = undef
91-
$client_package_uninstall_options = undef
9284
$package_provider = undef
9385
$home_dir_path = '/home'
9486
$sshd_path = '/usr/sbin/sshd'
@@ -110,11 +102,9 @@
110102
}
111103
'Darwin': {
112104
$server_package_name = undef
113-
$server_package_install_options = undef
114-
$server_package_uninstall_options = undef
105+
$package_install_options = undef
106+
$package_uninstall_options = undef
115107
$client_package_name = undef
116-
$client_package_install_options = undef
117-
$client_package_uninstall_options = undef
118108
$package_provider = undef
119109
$home_dir_path = '/home'
120110
$sshd_path = '/usr/sbin/sshd'
@@ -136,11 +126,9 @@
136126
}
137127
'windows': {
138128
$server_package_name = 'openssh'
139-
$server_package_install_options = ['-params', '""/SSHServerFeature""']
140-
$server_package_uninstall_options = ['-params','""/SSHServerFeature""']
141129
$client_package_name = 'openssh'
142-
$client_package_install_options = undef
143-
$client_package_uninstall_options = undef
130+
$package_install_options = ['-params', '""/SSHServerFeature""']
131+
$package_uninstall_options = ['-params','""/SSHServerFeature""']
144132
$package_provider = 'chocolatey'
145133
$home_dir_path = 'C:/Users'
146134
if $::architecture == 'x64' {
@@ -169,11 +157,9 @@
169157
}
170158
'ArchLinux': {
171159
$server_package_name = 'openssh'
172-
$server_package_install_options = undef
173-
$server_package_uninstall_options = undef
160+
$package_install_options = undef
161+
$package_uninstall_options = undef
174162
$client_package_name = 'openssh'
175-
$client_package_install_options = undef
176-
$client_package_uninstall_options = undef
177163
$package_provider = undef
178164
$home_dir_path = '/home'
179165
$sshd_path = '/usr/sbin/sshd'
@@ -195,11 +181,9 @@
195181
}
196182
'Suse': {
197183
$server_package_name = 'openssh'
198-
$server_package_install_options = undef
199-
$server_package_uninstall_options = undef
184+
$package_install_options = undef
185+
$package_uninstall_options = undef
200186
$client_package_name = 'openssh'
201-
$client_package_install_options = undef
202-
$client_package_uninstall_options = undef
203187
$package_provider = undef
204188
$home_dir_path = '/home'
205189
$sshd_path = '/usr/sbin/sshd'
@@ -246,11 +230,9 @@
246230
case $::operatingsystem {
247231
'SmartOS': {
248232
$server_package_name = undef
249-
$server_package_install_options = undef
250-
$server_package_uninstall_options = undef
233+
$package_install_options = undef
234+
$package_uninstall_options = undef
251235
$client_package_name = undef
252-
$client_package_install_options = undef
253-
$client_package_uninstall_options = undef
254236
$package_provider = undef
255237
$home_dir_path = '/home'
256238
$sshd_path = '/usr/sbin/sshd'
@@ -277,10 +259,8 @@
277259
$ssh_known_hosts = "${ssh_cfg_dir}/ssh_known_hosts"
278260
$service_name = 'svc:/network/ssh:default'
279261
$sftp_server_path = 'internal-sftp'
280-
$server_package_install_options = undef
281-
$server_package_uninstall_options = undef
282-
$client_package_install_options = undef
283-
$client_package_uninstall_options = undef
262+
$package_install_options = undef
263+
$package_uninstall_options = undef
284264
$package_provider = undef
285265
$home_dir_path = '/home'
286266
$sshd_path = '/usr/sbin/sshd'
@@ -316,11 +296,9 @@
316296
case $::operatingsystem {
317297
'Gentoo': {
318298
$server_package_name = 'openssh'
319-
$server_package_install_options = undef
320-
$server_package_uninstall_options = undef
299+
$package_install_options = undef
300+
$package_uninstall_options = undef
321301
$client_package_name = 'openssh'
322-
$client_package_install_options = undef
323-
$client_package_uninstall_options = undef
324302
$package_provider = undef
325303
$home_dir_path = '/home'
326304
$sshd_path = '/usr/sbin/sshd'
@@ -342,11 +320,9 @@
342320
}
343321
'Amazon': {
344322
$server_package_name = 'openssh-server'
345-
$server_package_install_options = undef
346-
$server_package_uninstall_options = undef
323+
$package_install_options = undef
324+
$package_uninstall_options = undef
347325
$client_package_name = 'openssh-clients'
348-
$client_package_install_options = undef
349-
$client_package_uninstall_options = undef
350326
$package_provider = undef
351327
$home_dir_path = '/home'
352328
$sshd_path = '/usr/sbin/sshd'

manifests/server/install.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
ensure_packages([$ssh::params::server_package_name], {
55
'ensure' => $ssh::server::ensure,
66
'provider' => $ssh::params::package_provider,
7-
'install_options' => $ssh::params::server_package_install_options,
8-
'uninstall_options' => $ssh::params::server_package_uninstall_options,
7+
'install_options' => $ssh::params::package_install_options,
8+
'uninstall_options' => $ssh::params::package_uninstall_options,
99
})
1010
}
1111
}

0 commit comments

Comments
 (0)