Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
Lysnetwork
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lysator
Puppet
Lysnetwork
Commits
9c3ba632
Commit
9c3ba632
authored
Aug 23, 2020
by
Filip Polbratt
Browse files
Options
Downloads
Patches
Plain Diff
Move to using hiera
parent
e6f7e5d3
No related branches found
No related tags found
No related merge requests found
Pipeline
#544
canceled
Aug 23, 2020
Stage: syntax
Stage: unit
Changes
5
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
data/Debian.yaml
+1
-0
1 addition, 0 deletions
data/Debian.yaml
data/RedHat.yaml
+1
-0
1 addition, 0 deletions
data/RedHat.yaml
data/SUSE.yaml
+2
-0
2 additions, 0 deletions
data/SUSE.yaml
data/common.yaml
+4
-1
4 additions, 1 deletion
data/common.yaml
manifests/ssh.pp
+7
-58
7 additions, 58 deletions
manifests/ssh.pp
with
15 additions
and
59 deletions
data/Debian.yaml
0 → 100644
+
1
−
0
View file @
9c3ba632
lysnetwork::ssh::client_package
:
openssh-client
This diff is collapsed.
Click to expand it.
data/RedHat.yaml
0 → 100644
+
1
−
0
View file @
9c3ba632
lysnetwork::ssh::service_name
:
sshd
This diff is collapsed.
Click to expand it.
data/SUSE.yaml
0 → 100644
+
2
−
0
View file @
9c3ba632
lysnetwork::ssh::server_package
:
openssh
lysnetwork::ssh::service_name
:
sshd
This diff is collapsed.
Click to expand it.
data/common.yaml
+
4
−
1
View file @
9c3ba632
---
{}
---
lysnetwork::ssh::server_package
:
openssh-server
lysnetwork::ssh::client_package
:
openssh
lysnetwork::ssh::service_name
:
ssh
This diff is collapsed.
Click to expand it.
manifests/ssh.pp
+
7
−
58
View file @
9c3ba632
#This class manages ssh-clients and ensures that fail2ban is installed with configs.
#This class manages ssh-clients and servers.
class
lysnetwork::ssh
{
class
lysnetwork::ssh
(
$server_package
=
$facts
[
'os'
][
'name'
]
?
{
$server_package
=
undef
,
'centos'
=>
'openssh-server'
,
$client_package
=
undef
,
'OpenSuSE'
=>
'openssh'
,
$service_name
=
undef
default
=>
'openssh-server'
,
)
{
}
$client_package
=
$facts
[
'os'
][
'name'
]
?
{
'centos'
=>
'openssh'
,
'OpenSuSE'
=>
'openssh'
,
'Debian'
=>
'openssh-client'
,
'Ubuntu'
=>
'openssh-client'
,
default
=>
'openssh'
,
}
$service_name
=
$facts
[
'os'
][
'name'
]
?
{
ensure_packages
([
$server_package
,
$client_package
])
'centos'
=>
'sshd'
,
'OpenSuSE'
=>
'sshd'
,
default
=>
'ssh'
,
}
package
{
$server_package
:
ensure
=>
installed
,
}
package
{
$client_package
:
ensure
=>
installed
,
}
service
{
$service_name
:
service
{
$service_name
:
ensure
=>
running
,
ensure
=>
running
,
...
@@ -64,34 +43,4 @@ class lysnetwork::ssh {
...
@@ -64,34 +43,4 @@ class lysnetwork::ssh {
source
=>
"puppet:///modules/lysnetwork/ssh/ssh_config-
$
{facts['os']['name']}"
,
source
=>
"puppet:///modules/lysnetwork/ssh/ssh_config-
$
{facts['os']['name']}"
,
}
}
package
{
'fail2ban'
:
ensure
=>
installed
,
before
=>
File
[
'/etc/fail2ban/jail.local'
],
}
service
{
'fail2ban'
:
ensure
=>
running
,
enable
=>
true
,
require
=>
[
Package
[
'fail2ban'
],
File
[
'/etc/fail2ban/jail.local'
],
File
[
'/etc/fail2ban/action.d/iptables-common.conf'
],],
}
file
{
'/etc/fail2ban/jail.local'
:
ensure
=>
file
,
owner
=>
'root'
,
group
=>
'root'
,
mode
=>
'0644'
,
source
=>
"puppet:///modules/lysnetwork/fail2ban/jail_local_ssh-
$
{facts['os']['name']}"
,
}
file
{
'/etc/fail2ban/action.d/iptables-common.conf'
:
ensure
=>
file
,
owner
=>
'root'
,
group
=>
'root'
,
mode
=>
'0644'
,
source
=>
'puppet:///modules/lysnetwork/fail2ban/actions_iptable_common'
,
}
}
}
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