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
13
Merge Requests
13
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
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
Show 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 @@
...
@@ -61,6 +61,10 @@
-
name
:
Delete default nameserver
-
name
:
Delete default nameserver
lineinfile
:
dest=/etc/resolv.conf line="nameserver 10.0.2.3" state=absent
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
-
name
:
ping current host
script
:
ping host {{ lookup('file', '/etc/opt/ipv4') }} {{ lookup('file', '/etc/opt/hostname') }}
script
:
ping host {{ lookup('file', '/etc/opt/ipv4') }} {{ lookup('file', '/etc/opt/hostname') }}
when
:
hostname_file.stat.exists == True
when
:
hostname_file.stat.exists == True
...
...
playbook/roles/vm-bootstrap/tasks/ssh.yml
View file @
6b13826b
...
@@ -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
:
update /etc/ssh/sshd_config
-
name
:
Check whether sshd_config is well configured
lineinfile
:
dest=/etc/ssh/sshd_config regexp="^PermitRootLogin (?!no)" line="PermitRootLogin no"
command
:
grep -wq "^PermitRootLogin no" /etc/ssh/sshd_config
notify
:
register
:
permitrootlogin
-
restart ssh
always_run
:
True
-
restart sshd
ignore_errors
:
True
changed_when
:
False
-
name
:
update /etc/ssh/sshd_config
-
name
:
update /etc/ssh/sshd_config
lineinfile
:
dest=/etc/ssh/sshd_config
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
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