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
d7b4cfc7
Commit
d7b4cfc7
authored
Feb 14, 2021
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add up/down script and change mac changing
parent
4c2aedf0
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
48 additions
and
4 deletions
+48
-4
files/bridge-post-scripts/down.sh.j2
files/bridge-post-scripts/down.sh.j2
+13
-0
files/bridge-post-scripts/post-down.sh.j2
files/bridge-post-scripts/post-down.sh.j2
+1
-0
files/bridge-post-scripts/post-up.sh.j2
files/bridge-post-scripts/post-up.sh.j2
+2
-2
files/bridge-post-scripts/pre-down.sh.j2
files/bridge-post-scripts/pre-down.sh.j2
+1
-1
files/bridge-post-scripts/pre-up.sh.j2
files/bridge-post-scripts/pre-up.sh.j2
+7
-0
files/bridge-post-scripts/up.sh.j2
files/bridge-post-scripts/up.sh.j2
+12
-0
files/interfaces.j2
files/interfaces.j2
+2
-1
interface-tasks/bridge.yaml
interface-tasks/bridge.yaml
+10
-0
No files found.
files/bridge-post-scripts/down.sh.j2
0 → 100644
View file @
d7b4cfc7
#!/bin/bash
source
{{
ansible_user_dir
}}
/nextgen-router/scripts/utility.sh
export
BRIDGE_NAME
={{
br.name
}}
{
%
if
br.mac is defined and br.mac %
}
# Change mac
export
BRIDGE_MAC
={{
br.mac
}}
export
BR
ip
link set
"
$BRIDGE_NAME
"
address
"
$BRIDGE_MAC
"
{
% endif %
}
true
files/bridge-post-scripts/post-down.sh.j2
View file @
d7b4cfc7
#!/bin/bash
#!/bin/bash
source
{{
ansible_user_dir
}}
/nextgen-router/scripts/utility.sh
source
{{
ansible_user_dir
}}
/nextgen-router/scripts/utility.sh
export
BRIDGE_NAME
={{
br.name
}}
{
%
if
br.macvlan is defined and br.macvlan %
}
{
%
if
br.macvlan is defined and br.macvlan %
}
# macvlans
# macvlans
...
...
files/bridge-post-scripts/post-up.sh.j2
View file @
d7b4cfc7
#!/bin/bash
#!/bin/bash
source
{{
ansible_user_dir
}}
/nextgen-router/scripts/utility.sh
source
{{
ansible_user_dir
}}
/nextgen-router/scripts/utility.sh
export
BRIDGE_NAME
={{
br.name
}}
export
BRIDGE_NAME
={{
br.name
}}
{
%
if
br.address is defined and br.address %
}
{
%
if
br.address is defined and br.address %
}
export
BRIDGE_ADDRESS
={{
br.address
}}
export
BRIDGE_ADDRESS
={{
br.address
}}
{
% endif %
}
{
% endif %
}
...
@@ -10,7 +10,7 @@ export BRIDGE_ADDRESS={{br.address}}
...
@@ -10,7 +10,7 @@ export BRIDGE_ADDRESS={{br.address}}
{
%
if
br.mac is defined and br.mac %
}
{
%
if
br.mac is defined and br.mac %
}
# Change mac
# Change mac
export
BRIDGE_MAC
={{
br.mac
}}
export
BRIDGE_MAC
={{
br.mac
}}
ip
link set
"
$BRIDGE_NAME
"
address
"
$BRIDGE_MAC
"
#
ip link set "$BRIDGE_NAME" address "$BRIDGE_MAC"
{
% endif %
}
{
% endif %
}
{
%
if
br.moreAddresses is defined and br.moreAddresses %
}
{
%
if
br.moreAddresses is defined and br.moreAddresses %
}
...
...
files/bridge-post-scripts/pre-down.sh.j2
View file @
d7b4cfc7
#!/bin/bash
#!/bin/bash
source
{{
ansible_user_dir
}}
/nextgen-router/scripts/utility.sh
source
{{
ansible_user_dir
}}
/nextgen-router/scripts/utility.sh
export
BRIDGE_NAME
={{
br.name
}}
export
BRIDGE_NAME
={{
br.name
}}
{
%
if
br.address is defined and br.address %
}
{
%
if
br.address is defined and br.address %
}
export
BRIDGE_ADDRESS
={{
br.address
}}
export
BRIDGE_ADDRESS
={{
br.address
}}
{
% endif %
}
{
% endif %
}
...
...
files/bridge-post-scripts/pre-up.sh.j2
View file @
d7b4cfc7
#!/bin/bash
#!/bin/bash
source
{{
ansible_user_dir
}}
/nextgen-router/scripts/utility.sh
source
{{
ansible_user_dir
}}
/nextgen-router/scripts/utility.sh
export
BRIDGE_NAME
={{
br.name
}}
{
%
if
br.macvlan is defined and br.macvlan %
}
{
%
if
br.macvlan is defined and br.macvlan %
}
# macvlans
# macvlans
...
@@ -16,4 +17,10 @@ ip link set {{br.name}}-{{link | regex_replace('\.', '-')}} up
...
@@ -16,4 +17,10 @@ ip link set {{br.name}}-{{link | regex_replace('\.', '-')}} up
{{
br.linkUp
}}
{{
br.linkUp
}}
{
% endif %
}
{
% endif %
}
{
%
if
br.mac is defined and br.mac %
}
# Change mac
export
BRIDGE_MAC
={{
br.mac
}}
# ip link set "$BRIDGE_NAME" address "$BRIDGE_MAC"
{
% endif %
}
true
true
files/bridge-post-scripts/up.sh.j2
0 → 100644
View file @
d7b4cfc7
#!/bin/bash
source
{{
ansible_user_dir
}}
/nextgen-router/scripts/utility.sh
export
BRIDGE_NAME
={{
br.name
}}
{
%
if
br.mac is defined and br.mac %
}
# Change mac
export
BRIDGE_MAC
={{
br.mac
}}
ip
link set
"
$BRIDGE_NAME
"
address
"
$BRIDGE_MAC
"
{
% endif %
}
true
files/interfaces.j2
View file @
d7b4cfc7
...
@@ -90,8 +90,9 @@ metric 9999
...
@@ -90,8 +90,9 @@ metric 9999
{% endif %}
{% endif %}
{% endif %}
{% endif %}
pre-up {{ansible_user_dir}}/nextgen-router/scripts/{{br.name}}/pre-up.sh
pre-up {{ansible_user_dir}}/nextgen-router/scripts/{{br.name}}/pre-up.sh
up {{ansible_user_dir}}/nextgen-router/scripts/{{br.name}}/up.sh
post-up {{ansible_user_dir}}/nextgen-router/scripts/{{br.name}}/post-up.sh
post-up {{ansible_user_dir}}/nextgen-router/scripts/{{br.name}}/post-up.sh
pre-down {{ansible_user_dir}}/nextgen-router/scripts/{{br.name}}/pre-
down.sh
down {{ansible_user_dir}}/nextgen-router/scripts/{{br.name}}/
down.sh
post-down {{ansible_user_dir}}/nextgen-router/scripts/{{br.name}}/post-down.sh
post-down {{ansible_user_dir}}/nextgen-router/scripts/{{br.name}}/post-down.sh
{% if br.mtu is defined and br.mtu %}
{% if br.mtu is defined and br.mtu %}
mtu {{br.mtu}}
mtu {{br.mtu}}
...
...
interface-tasks/bridge.yaml
View file @
d7b4cfc7
...
@@ -7,6 +7,11 @@
...
@@ -7,6 +7,11 @@
src
:
./files/bridge-post-scripts/pre-up.sh.j2
src
:
./files/bridge-post-scripts/pre-up.sh.j2
dest
:
'
{{ansible_user_dir}}/nextgen-router/scripts/{{br.name}}/pre-up.sh'
dest
:
'
{{ansible_user_dir}}/nextgen-router/scripts/{{br.name}}/pre-up.sh'
mode
:
0755
mode
:
0755
-
name
:
up script
template
:
src
:
./files/bridge-post-scripts/up.sh.j2
dest
:
'
{{ansible_user_dir}}/nextgen-router/scripts/{{br.name}}/up.sh'
mode
:
0755
-
name
:
post-up script
-
name
:
post-up script
template
:
template
:
src
:
./files/bridge-post-scripts/post-up.sh.j2
src
:
./files/bridge-post-scripts/post-up.sh.j2
...
@@ -22,3 +27,8 @@
...
@@ -22,3 +27,8 @@
src
:
./files/bridge-post-scripts/post-down.sh.j2
src
:
./files/bridge-post-scripts/post-down.sh.j2
dest
:
'
{{ansible_user_dir}}/nextgen-router/scripts/{{br.name}}/post-down.sh'
dest
:
'
{{ansible_user_dir}}/nextgen-router/scripts/{{br.name}}/post-down.sh'
mode
:
0755
mode
:
0755
-
name
:
down script
template
:
src
:
./files/bridge-post-scripts/down.sh.j2
dest
:
'
{{ansible_user_dir}}/nextgen-router/scripts/{{br.name}}/down.sh'
mode
:
0755
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