Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.package
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
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
Guillaume Hervier
slapos.package
Commits
5ab15cdf
Commit
5ab15cdf
authored
Sep 03, 2015
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix restart of sshd deamon at every run
parent
b6f077a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
playbook/roles/vm-bootstrap/tasks/ssh.yml
playbook/roles/vm-bootstrap/tasks/ssh.yml
+9
-6
No files found.
playbook/roles/vm-bootstrap/tasks/ssh.yml
View file @
5ab15cdf
...
@@ -45,14 +45,17 @@
...
@@ -45,14 +45,17 @@
authorized_key
:
user=root key="{{ lookup('file', '/etc/opt/authorized_keys') }}"
authorized_key
:
user=root key="{{ lookup('file', '/etc/opt/authorized_keys') }}"
when
:
authorized_keys.stat.exists == True
when
:
authorized_keys.stat.exists == True
-
name
:
Check whether sshd_config is well configured
command
:
grep -wq "^PermitRootLogin no" /etc/ssh/sshd_config
register
:
permitrootlogin
always_run
:
True
ignore_errors
:
True
changed_when
:
False
-
name
:
update /etc/ssh/sshd_config
-
name
:
update /etc/ssh/sshd_config
lineinfile
:
dest=/etc/ssh/sshd_config regexp="^PermitRootLogin (
?!no)" line="PermitRootLogin no"
lineinfile
:
dest=/etc/ssh/sshd_config regexp="^PermitRootLogin (
.*)" line="PermitRootLogin no" state=present
notify
:
notify
:
-
restart ssh
-
restart ssh
-
restart sshd
-
restart sshd
when
:
permitrootlogin.rc !=
0
-
name
:
update /etc/ssh/sshd_config
lineinfile
:
dest=/etc/ssh/sshd_config line="PermitRootLogin no"
notify
:
-
restart ssh
-
restart sshd
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