Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
nextgen-router
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
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
MyCard
nextgen-router
Commits
52fdd7df
Commit
52fdd7df
authored
Mar 08, 2022
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto assign bond interfaces
parent
e5974b74
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
0 deletions
+29
-0
files/interfaces.j2
files/interfaces.j2
+15
-0
files/netplan.yaml.j2
files/netplan.yaml.j2
+14
-0
No files found.
files/interfaces.j2
View file @
52fdd7df
...
@@ -9,6 +9,7 @@ iface lo inet loopback
...
@@ -9,6 +9,7 @@ iface lo inet loopback
# Links
# Links
{% if links is defined and links %}
{% for link in links %}
{% for link in links %}
## {{link.name}}
## {{link.name}}
auto {{link.name}}
auto {{link.name}}
...
@@ -16,6 +17,7 @@ iface {{link.name}} inet manual
...
@@ -16,6 +17,7 @@ iface {{link.name}} inet manual
iface {{link.name}} inet6 manual
iface {{link.name}} inet6 manual
{% endfor %}
{% endfor %}
{% endif %}
# end Links
# end Links
...
@@ -23,11 +25,24 @@ iface {{link.name}} inet6 manual
...
@@ -23,11 +25,24 @@ iface {{link.name}} inet6 manual
# Bonds
# Bonds
{% for bond in bonds %}
{% for bond in bonds %}
{% if ansible_distribution_major_version|int < 11 %}
## Slaves in bond {{bond.name}}
{% for link in bond.links %}
### Bond slave {{link}}
auto {{link}}
iface {{link}} inet manual
iface {{link}} inet6 manual
{% endfor %}
{% endif %}
## {{bond.name}}
## {{bond.name}}
auto {{bond.name}}
auto {{bond.name}}
iface {{bond.name}} inet manual
iface {{bond.name}} inet manual
iface {{bond.name}} inet6 manual
iface {{bond.name}} inet6 manual
{% if ansible_distribution_major_version|int < 11 %}
up ifconfig {{bond.name}} 0.0.0.0 up
up ifconfig {{bond.name}} 0.0.0.0 up
{% endif %}
{% if ansible_distribution_major_version|int >= 11 %}bond-{% endif %}slaves{% for link in bond.links %} {{link}}{% endfor %}
{% if ansible_distribution_major_version|int >= 11 %}bond-{% endif %}slaves{% for link in bond.links %} {{link}}{% endfor %}
bond-mode {{bond.mode}}
bond-mode {{bond.mode}}
...
...
files/netplan.yaml.j2
View file @
52fdd7df
...
@@ -2,11 +2,25 @@
...
@@ -2,11 +2,25 @@
network:
network:
version: '2'
version: '2'
ethernets:
ethernets:
{% if links is defined and links %}
{% for link in links %}
{% for link in links %}
'{{link.name}}':
'{{link.name}}':
dhcp4: false
dhcp4: false
dhcp6: false
dhcp6: false
{% endfor %}
{% endfor %}
{% endif %}
{% if bonds is defined and bonds %}
# Bonded interfaces
{% for bond in bonds %}
## Slaves in bond {{bond.name}}
{% for link in bond.links %}
### Bond slave {{link}}
'{{link}}':
dhcp4: false
dhcp6: false
{% endfor %}
{% endfor %}
{% endif %}
{% if bonds is defined and bonds and bonds | length > 0 %}
{% if bonds is defined and bonds and bonds | length > 0 %}
bonds:
bonds:
{% for bond in bonds %}
{% for bond in bonds %}
...
...
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