Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
base
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Lonlone Lee
base
Commits
d4a9dc54
Commit
d4a9dc54
authored
Nov 06, 2015
by
Adam Lewenberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
install correct package on wheezy
parent
2500a19e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
85 additions
and
1 deletion
+85
-1
manifests/ssh.pp
manifests/ssh.pp
+5
-1
manifests/ssh/package.pp
manifests/ssh/package.pp
+80
-0
No files found.
manifests/ssh.pp
View file @
d4a9dc54
...
...
@@ -12,7 +12,11 @@
class
base::ssh
(
$pam_duo
=
false
){
package
{
'openssh-server'
:
ensure
=>
present
}
# Install the openssh server package.
class
{
'base::ssh::package'
:
pam_duo
=>
$pam_duo
,
}
if
(
$pam_duo
)
{
include
base::duo
...
...
manifests/ssh/package.pp
0 → 100644
View file @
d4a9dc54
# Load the openssh package. This is a bit tricky depending on the version
# of the OS and whether or not we are using pam_duo.
class
base::ssh::package
(
$pam_duo
=
false
){
if
(
$pam_duo
)
{
# Make sure sshd (at least version 6.2 is installed)
case
$::operatingsystem
{
'Debian'
:
{
$sshd_package
=
'openssh-server'
# Debian wheezy is the oldest supported version
if
(
$::lsbmajdistrelease
<
7
)
{
fail
(
'pam_duo requires at least Debian wheezy'
)
}
elsif
(
$::lsbmajdistrelease
==
7
)
{
# On wheezy, pin the backported openssh
file
{
'/etc/apt/preferences.d/openssh'
:
ensure
=>
present
,
source
=>
'puppet:///modules/base/ssh/etc/apt/preferences.d/openssh'
,
}
}
}
'Ubuntu'
:
{
$sshd_package
=
'openssh-server'
# Ubuntu trusty is the oldest supported version
if
(
$::lsbmajdistrelease
<
14
)
{
fail
(
'pam_duo requires at least Ubuntu trusty'
)
}
}
# NOTE: The templates have not been fully-validated on RHEL-type systems,
# so pam_duo will still fail on them (just not in this section)
'RedHat'
,
'CentOS'
:
{
$sshd_package
=
'openssh-server'
# RHEL/CentOS 7 is the oldest supported version
if
(
$::lsbmajdistrelease
<
7
)
{
fail
(
'pam_duo requires at least RHEL/CentOS 7'
)
}
}
default
:
{
fail
(
'pam_duo is not supported on this OS.'
)
}
}
# Actually install the package with sshd now
if
!
defined
(
Package
[
$sshd_package
]
)
{
package
{
$sshd_package
:
ensure
=>
'installed'
,
}
}
else
{
# On Debian/Ubuntu, manually run aptitude to upgrade openssh-server
if
(
$::osfamily
==
'Debian'
)
{
exec
{
'update ssh'
:
command
=>
'aptitude -y install openssh-server'
,
path
=>
'/usr/bin'
,
provider
=>
shell
,
refreshonly
=>
true
,
require
=>
Exec
[
'aptitude_update_for_ssh'
],
}
exec
{
'aptitude_update_for_ssh'
:
command
=>
'aptitude update'
,
path
=>
'/usr/bin'
,
}
}
}
}
else
{
package
{
'openssh-server'
:
ensure
=>
present
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment