Commit 1a982dce authored by nanahira's avatar nanahira

system babeld

parent 5579f065
......@@ -143,7 +143,7 @@
src: babeld.conf.j2
dest: '{{ansible_user_dir}}/nextgen-network/services/babeld.conf'
#notify: restart_babeld
when: not noBird
when: not noBird and not systemBird
- name: monitor route plans
template:
src: route-plans.j2
......@@ -155,6 +155,7 @@
src: babeld-reload.conf.j2
dest: /tmp/babeld-reload.conf
notify: reload_babeld
when: not noBird
- name: frps conf
template:
src: protocols/wgfrp/frps.ini.j2
......@@ -182,32 +183,25 @@
# enabled: true
# masked: false
# when: systemBird
#- name: systemd babeld conf
# become: true
# template:
# src: babeld.conf.j2
# dest: '/etc/babeld.conf'
# #notify: restart_babeld_systemd
# when: systemBird
#- name: enable systemd babeld
# become: true
# systemd:
# name: babeld
# state: started
# enabled: true
# masked: false
# when: systemBird
- name: systemd babeld conf
become: true
template:
src: babeld.conf.j2
dest: '/etc/babeld.conf'
#notify: restart_babeld_systemd
when: not noBird and systemBird
- name: enable systemd babeld
become: true
systemd:
name: babeld
state: started
enabled: true
masked: false
when: not noBird and systemBird
handlers:
- name: reload_switch_rules
become: true
shell: '{{ansible_user_dir}}/nextgen-network/scripts/switch-rules-down.sh ; {{ansible_user_dir}}/nextgen-network/scripts/switch-rules-up.sh'
- name: restart_babeld # ocserv would be always restarted whenever key changes..
docker_compose:
project_src: '{{ansible_user_dir}}/nextgen-network/services'
restarted: true
services:
- babeld
when: not noBird
- name: reload_babeld
shell: cat /tmp/babeld-reload.conf | timeout 1 nc ::1 33123 || true
- name: restart_monitor
......@@ -252,12 +246,6 @@
# systemd:
# name: bird
# state: restarted
#- name: restart_babeld_systemd
# become: true
# systemd:
# name: babeld
# state: restarted
# when: systemBird
- name: reload_chnroute
become: true
shell: |
......
......@@ -19,6 +19,6 @@ ip addr del "$localRubbishAddress" dev "$dev"
{{ansible_user_dir}}/nextgen-network/scripts/predown.sh
{{ansible_user_dir}}/nextgen-network/scripts/postup.sh
echo -e "flush interface ${USERNAME}\ninterface $dev type tunnel rxcost $metric faraway true link-quality true \nquit" | nc ::1 33123
echo -e "flush interface ${USERNAME}\ninterface $dev type tunnel rxcost $metric faraway true link-quality true \nquit" | timeout 1 nc ::1 33123
true
......@@ -3,7 +3,7 @@
export dev="$DEVICE"
source /etc/ocserv/env-per-user/$USERNAME
echo -e "flush interface $dev\nquit" | nc ::1 33123
echo -e "flush interface $dev\nquit" | timeout 1 nc ::1 33123
{{ansible_user_dir}}/nextgen-network/scripts/predown.sh
......
......@@ -4,6 +4,6 @@ COMMAND="flush interface ${INTERFACE}\nquit"
COMMAND_BASE64=$(echo -e "$COMMAND" | base64 -w 0)
cd ansible
ansible wg -m shell -a "echo $COMMAND_BASE64 | base64 --decode | nc ::1 33123"
ansible wg -m shell -a "echo $COMMAND_BASE64 | base64 --decode | timeout 1 nc ::1 33123"
ansible wg -m systemd -b -a "name=wg-quick@${INTERFACE} state=stopped enabled=false"
cd ..
......@@ -236,6 +236,9 @@ class InventoryBuilder {
}
}
};
if (host.sysBird) {
delete host.dockerServices.babeld;
}
host.frpsNeeded = false;
const null_connection = '10000,null';
const lanInterfaces = host.lanInterfaces;
......
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