Commit b9e17bb1 authored by nanahira's avatar nanahira

add noBird and systemBird

parent 57355cdf
...@@ -91,22 +91,40 @@ ...@@ -91,22 +91,40 @@
copy: copy:
content: '{{dockerServices | to_yaml}}' content: '{{dockerServices | to_yaml}}'
dest: '{{ansible_user_dir}}/nextgen-network/services/docker-compose.yml' dest: '{{ansible_user_dir}}/nextgen-network/services/docker-compose.yml'
when: not noBird and not systemBird
- name: bird conf - name: bird conf
template: template:
src: bird.conf.j2 src: bird.conf.j2
dest: '{{ansible_user_dir}}/nextgen-network/services/bird.conf' dest: '{{ansible_user_dir}}/nextgen-network/services/bird.conf'
notify: restart_bird notify: restart_bird
when: not noBird and not systemBird
- name: frps conf - name: frps conf
template: template:
src: protocols/wgfrp/frps.ini.j2 src: protocols/wgfrp/frps.ini.j2
dest: '{{ansible_user_dir}}/nextgen-network/services/frps.ini' dest: '{{ansible_user_dir}}/nextgen-network/services/frps.ini'
when: frpsNeeded when: frpsNeeded and not noBird and not systemBird
notify: restart_frps notify: restart_frps
- name: start services - name: start services
docker_compose: docker_compose:
project_src: '{{ansible_user_dir}}/nextgen-network/services' project_src: '{{ansible_user_dir}}/nextgen-network/services'
remove_orphans: true remove_orphans: true
# pull: true # pull: true
when: not noBird and not systemBird
- name: systemd bird
become: true
template:
src: bird.conf.j2
dest: '/etc/bird/bird.conf'
notify: restart_bird_systemd
when: systemBird
- name: enable systemd bird
become: true
systemd:
name: bird
state: started
enabled: true
masked: false
when: systemBird
handlers: handlers:
- name: reload_switch_rules - name: reload_switch_rules
become: true become: true
...@@ -131,3 +149,8 @@ ...@@ -131,3 +149,8 @@
- frpc-{{item.name}} - frpc-{{item.name}}
with_items: '{{connections}}' with_items: '{{connections}}'
when: 'item.protocol == "wgfrp" and item.frpType == "frpc"' when: 'item.protocol == "wgfrp" and item.frpType == "frpc"'
- name: restart_bird_systemd
become: true
systemd:
name: bird
state: restarted
...@@ -181,7 +181,9 @@ class InventoryBuilder { ...@@ -181,7 +181,9 @@ class InventoryBuilder {
lanInterfaces, lanInterfaces,
masqInterfaces, masqInterfaces,
dockerServices: host.dockerServices, dockerServices: host.dockerServices,
routePlans routePlans,
noBird: !!(host.noBird || host.systemBird),
systemBird: !!host.systemBird
}; };
} }
......
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