Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
infra
ansible-shared
common
Commits
c8351162
Commit
c8351162
authored
2 years ago
by
Thomas Schneider
Browse files
Options
Downloads
Patches
Plain Diff
ssh-server: RHEL support
parent
724c16f0
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
ssh-server/handlers/main.yml
+2
-2
2 additions, 2 deletions
ssh-server/handlers/main.yml
ssh-server/tasks/main.yml
+28
-13
28 additions, 13 deletions
ssh-server/tasks/main.yml
with
30 additions
and
15 deletions
ssh-server/handlers/main.yml
+
2
−
2
View file @
c8351162
---
---
-
name
:
restart ssh
d
-
name
:
restart ssh
service
:
service
:
name
:
ssh
name
:
ssh
d
state
:
restarted
state
:
restarted
This diff is collapsed.
Click to expand it.
ssh-server/tasks/main.yml
+
28
−
13
View file @
c8351162
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
# file: roles/common/tasks/sshd.yml
# file: roles/common/tasks/sshd.yml
-
name
:
ensure sshd is installed
-
name
:
ensure sshd is installed
apt
:
package
:
name
:
openssh-server
name
:
openssh-server
state
:
present
state
:
present
tags
:
tags
:
...
@@ -17,7 +17,9 @@
...
@@ -17,7 +17,9 @@
mode
:
'
0644'
mode
:
'
0644'
backup
:
true
backup
:
true
validate
:
'
/usr/sbin/sshd
-t
-f
%s'
validate
:
'
/usr/sbin/sshd
-t
-f
%s'
when
:
ansible_distribution_major_version|int(default=99) <
11
when
:
-
is_debian
-
ansible_distribution_major_version|int(default=99) <
11
notify
:
notify
:
-
restart sshd
-
restart sshd
tags
:
tags
:
...
@@ -32,7 +34,9 @@
...
@@ -32,7 +34,9 @@
mode
:
'
0644'
mode
:
'
0644'
backup
:
true
backup
:
true
validate
:
'
/usr/sbin/sshd
-t
-f
%s'
validate
:
'
/usr/sbin/sshd
-t
-f
%s'
when
:
ansible_distribution_major_version|int(default=99) >
10
when
:
-
is_debian
-
ansible_distribution_major_version|int(default=99) >
10
notify
:
notify
:
-
restart sshd
-
restart sshd
tags
:
tags
:
...
@@ -47,7 +51,7 @@
...
@@ -47,7 +51,7 @@
mode
:
'
0644'
mode
:
'
0644'
backup
:
true
backup
:
true
validate
:
'
/usr/sbin/sshd
-t
-f
%s'
validate
:
'
/usr/sbin/sshd
-t
-f
%s'
when
:
ansible_distribution_major_version|int(default=99) >
10
when
:
not is_debian or
ansible_distribution_major_version|int(default=99) >
10
with_items
:
with_items
:
-
authentication.conf
-
authentication.conf
-
banner.conf
-
banner.conf
...
@@ -55,7 +59,7 @@
...
@@ -55,7 +59,7 @@
-
forwarding.conf
-
forwarding.conf
-
groups.conf
-
groups.conf
notify
:
notify
:
-
restart ssh
d
-
restart ssh
tags
:
tags
:
-
ssh
-
ssh
...
@@ -67,7 +71,9 @@
...
@@ -67,7 +71,9 @@
group
:
root
group
:
root
mode
:
'
0644'
mode
:
'
0644'
backup
:
true
backup
:
true
when
:
ansible_distribution_major_version|int(default=99) <
11
when
:
-
is_debian
-
ansible_distribution_major_version|int(default=99) <
11
tags
:
tags
:
-
ssh
-
ssh
...
@@ -79,7 +85,9 @@
...
@@ -79,7 +85,9 @@
group
:
root
group
:
root
mode
:
'
0644'
mode
:
'
0644'
backup
:
true
backup
:
true
when
:
ansible_distribution_major_version|int(default=99) >
10
when
:
-
is_debian
-
ansible_distribution_major_version|int(default=99) >
10
tags
:
tags
:
-
ssh
-
ssh
...
@@ -91,7 +99,7 @@
...
@@ -91,7 +99,7 @@
group
:
root
group
:
root
mode
:
'
0644'
mode
:
'
0644'
backup
:
true
backup
:
true
when
:
ansible_distribution_major_version|int(default=99) >
10
when
:
not is_debian or
ansible_distribution_major_version|int(default=99) >
10
with_items
:
with_items
:
-
gssapi.conf
-
gssapi.conf
-
sshfp.conf
-
sshfp.conf
...
@@ -105,8 +113,9 @@
...
@@ -105,8 +113,9 @@
owner
:
root
owner
:
root
group
:
root
group
:
root
mode
:
'
0644'
mode
:
'
0644'
when
:
is_debian
notify
:
notify
:
-
restart ssh
d
-
restart ssh
tags
:
tags
:
-
ssh
-
ssh
...
@@ -114,7 +123,9 @@
...
@@ -114,7 +123,9 @@
command
:
pam-auth-update --enable mkhomedir --force
command
:
pam-auth-update --enable mkhomedir --force
environment
:
environment
:
DEBIAN_FRONTEND
:
noninteractive
DEBIAN_FRONTEND
:
noninteractive
when
:
ssh_mkhomedir
when
:
-
ssh_mkhomedir
-
is_debian
tags
:
tags
:
-
ssh
-
ssh
-
pam
-
pam
...
@@ -123,14 +134,16 @@
...
@@ -123,14 +134,16 @@
command
:
pam-auth-update --remove mkhomedir --force
command
:
pam-auth-update --remove mkhomedir --force
environment
:
environment
:
DEBIAN_FRONTEND
:
noninteractive
DEBIAN_FRONTEND
:
noninteractive
when
:
not ssh_mkhomedir
when
:
-
not ssh_mkhomedir
-
is_debian
tags
:
tags
:
-
ssh
-
ssh
-
pam
-
pam
-
name
:
ensure sshd is running and enabled
-
name
:
ensure sshd is running and enabled
service
:
service
:
name
:
ssh
name
:
ssh
{{ "d" if is_rhel }}
state
:
started
state
:
started
enabled
:
true
enabled
:
true
tags
:
tags
:
...
@@ -192,7 +205,7 @@
...
@@ -192,7 +205,7 @@
-
root
-
root
-
name
:
ensure we fail2ban bad people
-
name
:
ensure we fail2ban bad people
apt
:
package
:
name
:
fail2ban
name
:
fail2ban
state
:
present
state
:
present
tags
:
tags
:
...
@@ -202,6 +215,7 @@
...
@@ -202,6 +215,7 @@
apt
:
apt
:
name
:
molly-guard
name
:
molly-guard
state
:
present
state
:
present
when
:
is_debian
tags
:
tags
:
-
molly
-
molly
-
shell
-
shell
...
@@ -214,6 +228,7 @@
...
@@ -214,6 +228,7 @@
owner
:
root
owner
:
root
group
:
root
group
:
root
mode
:
'
0644'
mode
:
'
0644'
when
:
is_debian
tags
:
tags
:
-
molly
-
molly
-
shell
-
shell
...
...
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