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
2190fcce
Commit
2190fcce
authored
Dec 09, 2020
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use netplan for link 2 interfaces in Ubuntu
parent
7b923191
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
69 additions
and
9 deletions
+69
-9
files/interfaces.j2
files/interfaces.j2
+7
-1
files/netplan.yaml.j2
files/netplan.yaml.j2
+35
-0
install.yaml
install.yaml
+4
-0
network.yaml
network.yaml
+3
-8
tasks/netplan.yaml
tasks/netplan.yaml
+20
-0
No files found.
files/interfaces.j2
View file @
2190fcce
...
...
@@ -4,6 +4,9 @@ source /etc/network/interfaces.d/*
auto lo
iface lo inet loopback
{% if ansible_distribution != 'Ubuntu' %}
### Configs in non-Ubuntu only
# Links
{% for link in links %}
...
...
@@ -25,7 +28,7 @@ up ifconfig {{bond.name}} 0.0.0.0 up
slaves{% for link in bond.links %} {{link}}{% endfor %}
bond-mode {{bond.mode}}
{% if bond.mode == 4 %}
{% if bond.mode == 4
or bond.mode == "802.3ad"
%}
bond-miimon 100
bond-downdelay 200
bond-updelay 200
...
...
@@ -45,6 +48,9 @@ iface {{vlan.link}}.{{vlan.tag}} inet6 manual
{% endfor %}
### end non-ubuntu
{% endif %}
# Bridges
{% for br in bridges %}
...
...
files/netplan.yaml.j2
0 → 100644
View file @
2190fcce
# MyCard NextGen router netplan config
network:
version: '2'
ethernets:
{% for link in links %}
'{{link.name}}':
dhcp4: false
dhcp6: false
{% endfor %}
bonds:
{% for bond in bonds %}
'{{bond.name}}':
interfaces:
{% for link in bond.links %}
- '{{link}}'
{% endfor %}
parameters:
mode: '{{bond.mode}}'
{% if bond.mode == "802.3ad" %}
lacp-rate: fast
min-links: 1
transmit-hash-policy: layer2+3
mii-monitor-interval: 100
{% endif %}
dhcp4: false
dhcp6: false
{% endfor %}
vlans:
{% for vlan in vlans %}
'{{vlan.link}}.{{vlan.tag}}':
id: {{vlan.tag}}
link: '{{vlan.link}}'
dhcp4: false
dhcp6: false
{% endfor %}
install.yaml
View file @
2190fcce
...
...
@@ -12,6 +12,10 @@
apt
:
name
:
net-tools,bridge-utils,ifenslave,vlan,pppoe,iproute2,iptables,ipset
update_cache
:
true
-
name
:
Ubuntu things
apt
:
name
:
netplan.io
when
:
ansible_distribution == 'Ubuntu'
-
name
:
pve things
apt
:
name
:
'
pve-headers-{{ansible_kernel}},ifupdown2'
...
...
network.yaml
View file @
2190fcce
...
...
@@ -34,15 +34,10 @@
-
name
:
clean some rubbish packages
become
:
true
apt
:
name
:
nplan,netplan.io,
resolvconf
name
:
resolvconf
state
:
absent
-
name
:
disable systemd-resolved
become
:
true
systemd
:
name
:
systemd-resolved
state
:
stopped
enabled
:
false
masked
:
true
-
name
:
Ubuntu netplan
include_tasks
:
./tasks/netplan.yaml
when
:
ansible_distribution == 'Ubuntu'
-
name
:
set resolv.conf
become
:
true
...
...
tasks/netplan.yaml
0 → 100644
View file @
2190fcce
-
name
:
clean old confs
become
:
true
file
:
path
:
/etc/netplan/{{item}}.yaml
state
:
absent
with_items
:
-
00-installer-config
-
50-cloud-init
-
name
:
netplan file
become
:
true
template
:
src
:
./files/netplan.yaml.j2
dest
:
/etc/netplan/00-mycard-nextgen-router.yaml
-
name
:
disable systemd-resolved
become
:
true
systemd
:
name
:
systemd-resolved
state
:
stopped
enabled
:
false
masked
:
true
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