Commit 1eacb39c authored by nanahira's avatar nanahira

add restartCron

parent 497e8b55
......@@ -143,6 +143,7 @@
become: true
blockinfile:
path: /etc/ppp/{{item}}-secrets
marker: '# {mark} MyCard NextGen Router block'
block: |
{% for user in pppoeUsers %}
"{{user.username}}" * "{{user.password}}"
......@@ -160,6 +161,18 @@
with_items:
- up
- down
- name: pppoe cron tasks
become: true
blockinfile:
path: /etc/crontab
marker: '# {mark} MyCard NextGen Router block'
block: |
{% for ppp in ppps %}
{% if ppp.restartCron is defined and ppp.restartCron %}
{{ppp.restartCron}} root /sbin/ifdown ppp{{ppp.id}} ; /sbin/ifup ppp{{ppp.id}}
{% endif %}
{% endfor %}
when: ppps is defined and ppps
- name: pppoe peer config
include_tasks: ./interface-tasks/pppoe.yaml
vars:
......@@ -176,6 +189,7 @@
become: true
blockinfile:
path: /etc/sysctl.conf
marker: '# {mark} MyCard NextGen Router block'
block: |
{% for br in bridges %}
net.ipv4.conf.{{br.name}}.rp_filter = 0
......
......@@ -57,6 +57,7 @@ vars:
address: 10.198.21.1 # 网关地址,填写 _use_first 使用可用地址第一个,填写 _use_last 使用可用地址最后一个
mac: null # 网关mac地址,为null则自动ping获取,但是bridge有启动坑容易获取失败
noOrigin: false # 是否关闭源进源出,对于专门peer的网关,这个可能很有用。
restartCron: '0 4 * * *' # 重启 crontab
up: null
down: null
mac: null
......
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