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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Nicolas Wavrant
slapos.package
Commits
6b13826b
Commit
6b13826b
authored
Sep 03, 2015
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'logging' into 'master'
Logging See merge request !18
parents
7436ece4
8f16b9c1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
6 deletions
+13
-6
playbook/roles/vm-bootstrap/tasks/hostname.yml
playbook/roles/vm-bootstrap/tasks/hostname.yml
+4
-0
playbook/roles/vm-bootstrap/tasks/ssh.yml
playbook/roles/vm-bootstrap/tasks/ssh.yml
+9
-6
No files found.
playbook/roles/vm-bootstrap/tasks/hostname.yml
View file @
6b13826b
...
...
@@ -61,6 +61,10 @@
-
name
:
Delete default nameserver
lineinfile
:
dest=/etc/resolv.conf line="nameserver 10.0.2.3" state=absent
-
name
:
Turn off dhclient if it's running
shell
:
pkill dhclient
ignore_errors
:
True
-
name
:
ping current host
script
:
ping host {{ lookup('file', '/etc/opt/ipv4') }} {{ lookup('file', '/etc/opt/hostname') }}
when
:
hostname_file.stat.exists == True
...
...
playbook/roles/vm-bootstrap/tasks/ssh.yml
View file @
6b13826b
...
...
@@ -45,14 +45,17 @@
authorized_key
:
user=root key="{{ lookup('file', '/etc/opt/authorized_keys') }}"
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
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
:
-
restart ssh
-
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