Commit 663bb7a1 authored by nanahira's avatar nanahira

simplify

parent 22cd8097
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
with_items: '{{routeLists.mycard}}' with_items: '{{routeLists.mycard}}'
- name: ocserv pre-configure - name: ocserv pre-configure
include_tasks: 'protocols/oc/ocserv-pre.yaml' include_tasks: 'protocols/oc/ocserv-pre.yaml'
when: ocservNeeded and not noBird and not systemBird when: ocservNeeded and not noBird
# 为了提高测试时候的性能,不改动wg的时候注释掉这段 # 为了提高测试时候的性能,不改动wg的时候注释掉这段
- name: 'clean up null connections first' - name: 'clean up null connections first'
include_tasks: 'protocols/{{item.protocol}}/configure.yaml' include_tasks: 'protocols/{{item.protocol}}/configure.yaml'
...@@ -97,25 +97,25 @@ ...@@ -97,25 +97,25 @@
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 when: not noBird
- 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 when: not noBird
- 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 and not noBird and not systemBird when: frpsNeeded and not noBird
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 when: not noBird
- name: systemd bird - name: systemd bird
become: true become: true
template: template:
...@@ -141,14 +141,14 @@ ...@@ -141,14 +141,14 @@
restarted: true restarted: true
services: services:
- bird - bird
when: not noBird and not systemBird when: not noBird
- name: restart_frps - name: restart_frps
docker_compose: docker_compose:
project_src: '{{ansible_user_dir}}/nextgen-network/services' project_src: '{{ansible_user_dir}}/nextgen-network/services'
restarted: true restarted: true
services: services:
- frps - frps
when: not noBird and not systemBird when: not noBird
- name: restart_frpc - name: restart_frpc
docker_compose: docker_compose:
project_src: '{{ansible_user_dir}}/nextgen-network/services' project_src: '{{ansible_user_dir}}/nextgen-network/services'
...@@ -156,14 +156,14 @@ ...@@ -156,14 +156,14 @@
services: services:
- frpc-{{item.name}} - frpc-{{item.name}}
with_items: '{{connections}}' with_items: '{{connections}}'
when: 'item.protocol == "wgfrp" and item.frpType == "frpc"' and not noBird and not systemBird when: 'item.protocol == "wgfrp" and item.frpType == "frpc"' and not noBird
- name: restart_ocserv - name: restart_ocserv
docker_compose: docker_compose:
project_src: '{{ansible_user_dir}}/nextgen-network/services' project_src: '{{ansible_user_dir}}/nextgen-network/services'
restarted: true restarted: true
services: services:
- ocserv - ocserv
when: not noBird and not systemBird when: not noBird
- name: restart_openconnect - name: restart_openconnect
docker_compose: docker_compose:
project_src: '{{ansible_user_dir}}/nextgen-network/services' project_src: '{{ansible_user_dir}}/nextgen-network/services'
...@@ -171,7 +171,7 @@ ...@@ -171,7 +171,7 @@
services: services:
- openconnect-{{item.name}} - openconnect-{{item.name}}
with_items: '{{connections}}' with_items: '{{connections}}'
when: 'item.protocol == "oc" and item.ocType == "client"' and not noBird and not systemBird when: 'item.protocol == "oc" and item.ocType == "client"' and not noBird
- name: restart_bird_systemd - name: restart_bird_systemd
become: true become: true
systemd: systemd:
......
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