Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
base
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
puppetpublic
base
Commits
d4a9dc54
Commit
d4a9dc54
authored
9 years ago
by
Adam Lewenberg
Browse files
Options
Downloads
Patches
Plain Diff
install correct package on wheezy
parent
2500a19e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
manifests/ssh.pp
+5
-1
5 additions, 1 deletion
manifests/ssh.pp
manifests/ssh/package.pp
+80
-0
80 additions, 0 deletions
manifests/ssh/package.pp
with
85 additions
and
1 deletion
manifests/ssh.pp
+
5
−
1
View file @
d4a9dc54
...
@@ -12,7 +12,11 @@
...
@@ -12,7 +12,11 @@
class
base::ssh
(
class
base::ssh
(
$pam_duo
=
false
$pam_duo
=
false
){
){
package
{
'openssh-server'
:
ensure
=>
present
}
# Install the openssh server package.
class
{
'base::ssh::package'
:
pam_duo
=>
$pam_duo
,
}
if
(
$pam_duo
)
{
if
(
$pam_duo
)
{
include
base::duo
include
base::duo
...
...
This diff is collapsed.
Click to expand it.
manifests/ssh/package.pp
0 → 100644
+
80
−
0
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
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment