Commit 1bd6ce0c authored by nanahira's avatar nanahira

add preup support

parent aa0ed1b5
......@@ -85,8 +85,13 @@ metric {{ 1100 + br.gateways[0].id }}
metric 9999
{% endif %}
{% endif %}
pre-up {{ansible_user_dir}}/nextgen-router/scripts/{{br.name}}/pre-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
post-down {{ansible_user_dir}}/nextgen-router/scripts/{{br.name}}/post-down.sh
{% if br.mtu is defined and br.mtu %}
mtu {{br.mtu}}
{% endif %}
{% endfor %}
......
......@@ -2,6 +2,11 @@
file:
path: '{{ansible_user_dir}}/nextgen-router/scripts/{{br.name}}'
state: directory
- name: pre-up script
template:
src: ./files/bridge-post-scripts/pre-up.sh.j2
dest: '{{ansible_user_dir}}/nextgen-router/scripts/{{br.name}}/pre-up.sh'
mode: 0755
- name: post-up script
template:
src: ./files/bridge-post-scripts/post-up.sh.j2
......@@ -12,3 +17,8 @@
src: ./files/bridge-post-scripts/pre-down.sh.j2
dest: '{{ansible_user_dir}}/nextgen-router/scripts/{{br.name}}/pre-down.sh'
mode: 0755
- name: pre-down script
template:
src: ./files/bridge-post-scripts/post-down.sh.j2
dest: '{{ansible_user_dir}}/nextgen-router/scripts/{{br.name}}/post-down.sh'
mode: 0755
......@@ -28,11 +28,14 @@ vars:
- 10.0.0.2/24 # 备选地址
gateways: null # 网关,看下面
masq: false # 是否MASQ
linkUp: echo 'link up' # 链路启动脚本,用于奇怪的特殊链路或者netns
up: echo "up" # 启动脚本和关闭脚本
down: echo "down"
linkDown: echo 'link down'
mac: null # 自定义mac地址,否则bridge随机,注意dhcp会以原始mac请求dhcp,因此不建议dhcp模式使用
dhcpv6Client: false # 是否进行 dhcpv6 请求
dhcpv6Receive: true # DHCPv6得到的地址的落脚点,只能有1个LAN获得
mtu: 1500
dhcp: # 是否开启dhcp,不是的话直接没有这一栏
start: 10.0.0.100
end: 10.0.0.240
......
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