Skip to content
This repository was archived by the owner on Jul 14, 2022. It is now read-only.

Commit d13c324

Browse files
committed
Add support for Ubuntu 16.04 LTS
1 parent 8d7c127 commit d13c324

File tree

8 files changed

+235
-5
lines changed

8 files changed

+235
-5
lines changed

Gemfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ gem 'puppet-lint-alias-check'
1616
gem 'puppet-lint-empty_string-check'
1717
gem 'puppet-lint-file_ensure-check'
1818
gem 'puppet-lint-file_source_rights-check'
19-
gem 'puppet-lint-fileserver-check'
2019
gem 'puppet-lint-leading_zero-check'
2120
gem 'puppet-lint-spaceship_operator_without_tag-check'
2221
gem 'puppet-lint-trailing_comma-check'

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ only), 1.9.3, 2.0.0, 2.1.0 and 2.3.1 (Puppet v4 only).
3232
* SLES 12
3333
* Ubuntu 12.04 LTS
3434
* Ubuntu 14.04 LTS
35+
* Ubuntu 16.04 LTS
3536
* Solaris 9
3637
* Solaris 10
3738
* Solaris 11

manifests/init.pp

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,26 +169,38 @@
169169
}
170170
}
171171
'Debian': {
172+
# Ubuntu 16.04
173+
if $::operatingsystemrelease == '16.04' {
174+
$default_sshd_config_hostkey = [
175+
'/etc/ssh/ssh_host_rsa_key',
176+
'/etc/ssh/ssh_host_dsa_key',
177+
'/etc/ssh/ssh_host_ecdsa_key',
178+
'/etc/ssh/ssh_host_ed25519_key',
179+
]
180+
$default_ssh_config_hash_known_hosts = 'yes'
181+
$default_sshd_config_xauth_location = undef
182+
} else {
183+
$default_sshd_config_hostkey = [ '/etc/ssh/ssh_host_rsa_key' ]
184+
$default_ssh_config_hash_known_hosts = 'no'
185+
$default_sshd_config_xauth_location = '/usr/bin/xauth'
186+
}
172187
$default_packages = ['openssh-server',
173188
'openssh-client']
174189
$default_service_name = 'ssh'
175190
$default_ssh_config_forward_x11_trusted = 'yes'
176-
$default_ssh_config_hash_known_hosts = 'no'
177191
$default_ssh_package_source = undef
178192
$default_ssh_package_adminfile = undef
179193
$default_ssh_sendenv = true
180194
$default_sshd_config_subsystem_sftp = '/usr/lib/openssh/sftp-server'
181195
$default_sshd_config_mode = '0600'
182196
$default_sshd_config_use_dns = 'yes'
183-
$default_sshd_config_xauth_location = '/usr/bin/xauth'
184197
$default_sshd_use_pam = 'yes'
185198
$default_sshd_gssapikeyexchange = undef
186199
$default_sshd_pamauthenticationviakbdint = undef
187200
$default_sshd_gssapicleanupcredentials = 'yes'
188201
$default_sshd_acceptenv = true
189202
$default_service_hasstatus = true
190203
$default_sshd_config_serverkeybits = '1024'
191-
$default_sshd_config_hostkey = [ '/etc/ssh/ssh_host_rsa_key' ]
192204
$default_sshd_addressfamily = 'any'
193205
}
194206
'Solaris': {

metadata.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@
8484
"operatingsystem": "Ubuntu",
8585
"operatingsystemrelease": [
8686
"12.04",
87-
"14.04"
87+
"14.04",
88+
"16.04"
8889
]
8990
}
9091
],

spec/classes/init_spec.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,19 @@
184184
:sshd_config_fixture => 'sshd_config_solaris',
185185
:ssh_config_fixture => 'ssh_config_solaris',
186186
},
187+
'Ubuntu-1604' => {
188+
:architecture => 'x86_64',
189+
:osfamily => 'Debian',
190+
:operatingsystemrelease => '16.04',
191+
:ssh_version => 'OpenSSH_7.2p2',
192+
:ssh_version_numeric => '7.2',
193+
:ssh_packages => ['openssh-server', 'openssh-client'],
194+
:sshd_config_mode => '0600',
195+
:sshd_service_name => 'ssh',
196+
:sshd_service_hasstatus => true,
197+
:sshd_config_fixture => 'sshd_config_ubuntu1604',
198+
:ssh_config_fixture => 'ssh_config_ubuntu1604',
199+
},
187200
}
188201

189202
osfamily_matrix.each do |os, facts|

spec/fixtures/ssh_config_ubuntu1604

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# This file is being maintained by Puppet.
2+
# DO NOT EDIT
3+
4+
# $OpenBSD: ssh_config,v 1.21 2005/12/06 22:38:27 reyk Exp $
5+
6+
# This is the ssh client system-wide configuration file. See
7+
# ssh_config(5) for more information. This file provides defaults for
8+
# users, and the values can be changed in per-user configuration files
9+
# or on the command line.
10+
11+
# Configuration data is parsed as follows:
12+
# 1. command line options
13+
# 2. user-specific file
14+
# 3. system-wide file
15+
# Any configuration value is only changed the first time it is set.
16+
# Thus, host-specific definitions should be at the beginning of the
17+
# configuration file, and defaults at the end.
18+
19+
# Site-wide defaults for some commonly used options. For a comprehensive
20+
# list of available options, their meanings and defaults, please see the
21+
# ssh_config(5) man page.
22+
23+
# Host *
24+
# ForwardAgent no
25+
# ForwardX11 no
26+
# RhostsRSAAuthentication no
27+
# RSAAuthentication yes
28+
PasswordAuthentication yes
29+
PubkeyAuthentication yes
30+
# HostbasedAuthentication no
31+
# BatchMode no
32+
# CheckHostIP yes
33+
# AddressFamily any
34+
# ConnectTimeout 0
35+
# StrictHostKeyChecking ask
36+
# IdentityFile ~/.ssh/identity
37+
IdentityFile ~/.ssh/id_rsa
38+
IdentityFile ~/.ssh/id_dsa
39+
# Port 22
40+
Protocol 2
41+
# Cipher 3des
42+
# Ciphers aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc
43+
# EscapeChar ~
44+
# Tunnel no
45+
# TunnelDevice any:any
46+
# PermitLocalCommand no
47+
# HashKnownHosts no
48+
HashKnownHosts yes
49+
GlobalKnownHostsFile /etc/ssh/ssh_known_hosts
50+
Host *
51+
# GSSAPIAuthentication yes
52+
GSSAPIAuthentication yes
53+
# If this option is set to yes then remote X11 clients will have full access
54+
# to the original X11 display. As virtually no X11 client supports the untrusted
55+
# mode correctly we set this to yes.
56+
ForwardX11Trusted yes
57+
UseRoaming no
58+
# Send locale-related environment variables
59+
SendEnv LANG LANGUAGE LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
60+
SendEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
61+
SendEnv LC_IDENTIFICATION LC_ALL

spec/fixtures/sshd_config_ubuntu1604

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
# This file is being maintained by Puppet.
2+
# DO NOT EDIT
3+
4+
# $OpenBSD: sshd_config,v 1.73 2005/12/06 22:38:28 reyk Exp $
5+
6+
# This is the sshd server system-wide configuration file. See
7+
# sshd_config(5) for more information.
8+
9+
# This sshd was compiled with PATH=/usr/local/bin:/bin:/usr/bin
10+
11+
# The strategy used for options in the default sshd_config shipped with
12+
# OpenSSH is to specify options with their default value where
13+
# possible, but leave them commented. Uncommented options change a
14+
# default value.
15+
16+
#Port 22
17+
Port 22
18+
#Protocol 2,1
19+
Protocol 2
20+
#AddressFamily any
21+
AddressFamily any
22+
23+
# HostKey for protocol version 1
24+
#HostKey /etc/ssh/ssh_host_key
25+
# HostKeys for protocol version 2
26+
#HostKey /etc/ssh/ssh_host_rsa_key
27+
#HostKey /etc/ssh/ssh_host_dsa_key
28+
HostKey /etc/ssh/ssh_host_rsa_key
29+
HostKey /etc/ssh/ssh_host_dsa_key
30+
HostKey /etc/ssh/ssh_host_ecdsa_key
31+
HostKey /etc/ssh/ssh_host_ed25519_key
32+
33+
# Lifetime and size of ephemeral version 1 server key
34+
#KeyRegenerationInterval 1h
35+
#ServerKeyBits 1024
36+
ServerKeyBits 1024
37+
# Logging
38+
# obsoletes QuietMode and FascistLogging
39+
#SyslogFacility AUTH
40+
SyslogFacility AUTH
41+
#LogLevel INFO
42+
LogLevel INFO
43+
44+
# Authentication:
45+
46+
#LoginGraceTime 120
47+
LoginGraceTime 120
48+
#PermitRootLogin yes
49+
PermitRootLogin yes
50+
#StrictModes yes
51+
#MaxAuthTries 6
52+
53+
#RSAAuthentication yes
54+
#PubkeyAuthentication yes
55+
PubkeyAuthentication yes
56+
#AuthorizedKeysFile .ssh/authorized_keys
57+
58+
# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
59+
#RhostsRSAAuthentication no
60+
# similar for protocol version 2
61+
#HostbasedAuthentication no
62+
HostbasedAuthentication no
63+
# Change to yes if you don't trust ~/.ssh/known_hosts for
64+
# RhostsRSAAuthentication and HostbasedAuthentication
65+
#IgnoreUserKnownHosts no
66+
IgnoreUserKnownHosts no
67+
# Don't read the user's ~/.rhosts and ~/.shosts files
68+
#IgnoreRhosts yes
69+
IgnoreRhosts yes
70+
71+
# To disable tunneled clear text passwords, change to no here!
72+
#PasswordAuthentication yes
73+
PasswordAuthentication yes
74+
#PermitEmptyPasswords no
75+
76+
# Change to no to disable s/key passwords
77+
#ChallengeResponseAuthentication yes
78+
ChallengeResponseAuthentication yes
79+
80+
# Kerberos options
81+
#KerberosOrLocalPasswd yes
82+
#KerberosTicketCleanup yes
83+
#KerberosGetAFSToken no
84+
85+
# GSSAPI options
86+
#GSSAPIAuthentication no
87+
GSSAPIAuthentication yes
88+
#GSSAPICleanupCredentials yes
89+
GSSAPICleanupCredentials yes
90+
91+
# Set this to 'yes' to enable PAM authentication, account processing,
92+
# and session processing. If this is enabled, PAM authentication will
93+
# be allowed through the ChallengeResponseAuthentication mechanism.
94+
# Depending on your PAM configuration, this may bypass the setting of
95+
# PasswordAuthentication, PermitEmptyPasswords, and
96+
# "PermitRootLogin without-password". If you just want the PAM account and
97+
# session checks to run without PAM authentication, then enable this but set
98+
# ChallengeResponseAuthentication=no
99+
#UsePAM no
100+
UsePAM yes
101+
102+
# Accept locale-related environment variables
103+
AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
104+
AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
105+
AcceptEnv LC_IDENTIFICATION LC_ALL
106+
#AllowTcpForwarding yes
107+
AllowTcpForwarding yes
108+
#GatewayPorts no
109+
#X11Forwarding no
110+
X11Forwarding yes
111+
#X11DisplayOffset 10
112+
#X11UseLocalhost yes
113+
#PrintMotd yes
114+
PrintMotd yes
115+
#PrintLastLog yes
116+
#TCPKeepAlive yes
117+
TCPKeepAlive yes
118+
#UseLogin no
119+
#UsePrivilegeSeparation yes
120+
#PermitUserEnvironment no
121+
#Compression delayed
122+
#ClientAliveInterval 0
123+
ClientAliveInterval 0
124+
ClientAliveCountMax 3
125+
#ShowPatchLevel no
126+
#UseDNS yes
127+
UseDNS yes
128+
#PidFile /var/run/sshd.pid
129+
#MaxStartups 10:30:100
130+
#MaxSessions 10
131+
132+
#PermitTunnel no
133+
#ChrootDirectory none
134+
135+
# no default banner path
136+
#Banner none
137+
Banner none
138+
139+
# override default of no subsystems
140+
Subsystem sftp /usr/lib/openssh/sftp-server
141+

templates/sshd_config.erb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,11 @@ ForceCommand <%= @sshd_config_forcecommand %>
207207
#Banner none
208208
Banner <%= @sshd_config_banner %>
209209

210+
<% if @sshd_config_xauth_location_real -%>
210211
#XAuthLocation /usr/bin/xauth
211212
XAuthLocation <%= @sshd_config_xauth_location_real %>
212213

214+
<% end -%>
213215
# override default of no subsystems
214216
Subsystem sftp <%= @sshd_config_subsystem_sftp_real %>
215217

0 commit comments

Comments
 (0)