Commit d7b4cfc7 authored by nanahira's avatar nanahira

add up/down script and change mac changing

parent 4c2aedf0
#!/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
#!/bin/bash
source {{ansible_user_dir}}/nextgen-router/scripts/utility.sh
export BRIDGE_NAME={{br.name}}
{% if br.macvlan is defined and br.macvlan %}
# macvlans
......
#!/bin/bash
source {{ansible_user_dir}}/nextgen-router/scripts/utility.sh
export BRIDGE_NAME={{br.name}}
{% if br.address is defined and br.address %}
export BRIDGE_ADDRESS={{br.address}}
{% endif %}
......@@ -10,7 +10,7 @@ export BRIDGE_ADDRESS={{br.address}}
{% if br.mac is defined and br.mac %}
# Change mac
export BRIDGE_MAC={{br.mac}}
ip link set "$BRIDGE_NAME" address "$BRIDGE_MAC"
# ip link set "$BRIDGE_NAME" address "$BRIDGE_MAC"
{% endif %}
{% if br.moreAddresses is defined and br.moreAddresses %}
......
#!/bin/bash
source {{ansible_user_dir}}/nextgen-router/scripts/utility.sh
export BRIDGE_NAME={{br.name}}
{% if br.address is defined and br.address %}
export BRIDGE_ADDRESS={{br.address}}
{% endif %}
......
#!/bin/bash
source {{ansible_user_dir}}/nextgen-router/scripts/utility.sh
export BRIDGE_NAME={{br.name}}
{% if br.macvlan is defined and br.macvlan %}
# macvlans
......@@ -16,4 +17,10 @@ ip link set {{br.name}}-{{link | regex_replace('\.', '-')}} up
{{br.linkUp}}
{% 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
#!/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
......@@ -90,8 +90,9 @@ metric 9999
{% endif %}
{% endif %}
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
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
{% if br.mtu is defined and br.mtu %}
mtu {{br.mtu}}
......
......@@ -7,6 +7,11 @@
src: ./files/bridge-post-scripts/pre-up.sh.j2
dest: '{{ansible_user_dir}}/nextgen-router/scripts/{{br.name}}/pre-up.sh'
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
template:
src: ./files/bridge-post-scripts/post-up.sh.j2
......@@ -22,3 +27,8 @@
src: ./files/bridge-post-scripts/post-down.sh.j2
dest: '{{ansible_user_dir}}/nextgen-router/scripts/{{br.name}}/post-down.sh'
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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment