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
Arnaud Véron
slapos.package
Commits
3f629ba4
Commit
3f629ba4
authored
Jul 23, 2018
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playbook/vm-bootstrap: prevent default route auto configuration on interface eth0
parent
57c90ac6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
playbook/roles/vm-bootstrap/tasks/network.yml
playbook/roles/vm-bootstrap/tasks/network.yml
+18
-0
No files found.
playbook/roles/vm-bootstrap/tasks/network.yml
View file @
3f629ba4
...
...
@@ -8,6 +8,24 @@
stat
:
path=/etc/opt/gateway
register
:
gateway_file
-
stat
:
path=/etc/sysconfig/network-scripts/ifcfg-eth0
register
:
ifcfg_eth0
-
stat
:
path=/etc/network/interfaces
register
:
iface_config
-
name
:
Disable network default route on interface eth0/CentOS
lineinfile
:
dest={{ ifcfg_eth0.stat.path }} state=present line="DEFROUTE=no"
when
:
ifcfg_eth0.stat.exists == True and gateway_file.stat.exists == True
-
name
:
Disable network default route on interface eth0/Debian-Ubuntu
lineinfile
:
dest
:
"
{{
iface_config.stat.path
}}"
state
:
present
line
:
"
post-up
route
del
default
dev
eth0"
insertafter
:
"
iface
eth0
inet
dhcp"
when
:
iface_config.stat.exists == True and gateway_file.stat.exists == True
-
name
:
Check default route
shell
:
/sbin/ip route list | grep default
register
:
default_route
...
...
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