Commit 34dded36 authored by nanahira's avatar nanahira

ignore errors on single connections

parent 88ad7886
......@@ -41,22 +41,6 @@
- name: mycard ipset
shell: 'ipset add mycard {{item}} || true'
with_items: '{{route_lists.mycard}}'
# 为了提高测试时候的性能,不改动wg的时候注释掉这段
- name: 'clean up null connections first'
include_tasks: 'protocols/{{item.protocol}}/configure.yaml'
vars:
conn: '{{item}}'
with_items: '{{ connections }}'
when: "item.protocol == 'null'"
- name: 'loop through list from a variable'
include_tasks: 'protocols/{{item.protocol}}/configure.yaml'
vars:
conn: '{{item}}'
with_items: '{{ connections }}'
when: "item.protocol != 'null'"
- name: 'frps'
include_tasks: 'protocols/wgfrp/frps.yaml'
when: 'frps_needed is defined'
- name: 鸟配置 (Debian)
template:
src: bird.conf.j2
......@@ -80,6 +64,22 @@
name: bird
state: started
enabled: yes
# 为了提高测试时候的性能,不改动wg的时候注释掉这段
- name: 'clean up null connections first'
include_tasks: 'protocols/{{item.protocol}}/configure.yaml'
vars:
conn: '{{item}}'
with_items: '{{ connections }}'
when: "item.protocol == 'null'"
- name: 'loop through list from a variable'
include_tasks: 'protocols/{{item.protocol}}/configure.yaml'
vars:
conn: '{{item}}'
with_items: '{{ connections }}'
when: "item.protocol != 'null'"
- name: 'frps'
include_tasks: 'protocols/wgfrp/frps.yaml'
when: 'frps_needed is defined'
handlers:
- name: restart_bird
systemd:
......
......@@ -20,19 +20,22 @@
name: 'wg-quick@{{conn.name}}'
state: started
enabled: yes
#ignore_errors: true
ignore_errors: true
register: 'wg_enable_result'
- name: '{{conn.name}}: restart wg'
systemd:
name: 'wg-quick@{{conn.name}}'
state: restarted
when: 'not wg_enable_result.changed and wg_conf_result.changed'
ignore_errors: true
- name: '{{conn.name}}: config for setconf'
template:
src: wg-setconf.conf.j2
dest: '/tmp/{{conn.name}}-setconf.conf'
register: 'wg_setconf_result'
ignore_errors: true
when: 'not wg_enable_result.changed and not wg_conf_result.changed'
- name: '{{conn.name}}: wg setconf'
ignore_errors: true
shell: 'wg setconf {{conn.name}} /tmp/{{conn.name}}-setconf.conf'
when: 'not wg_enable_result.changed and not wg_conf_result.changed and wg_setconf_result.changed'
......@@ -35,19 +35,22 @@
name: 'wg-quick@{{conn.name}}'
state: started
enabled: yes
#ignore_errors: true
ignore_errors: true
register: wg_enable_result
- name: '{{conn.name}}: restart wg'
ignore_errors: true
systemd:
name: 'wg-quick@{{conn.name}}'
state: restarted
when: 'not wg_enable_result.changed and wg_conf_result.changed'
- name: '{{conn.name}}: config for setconf'
ignore_errors: true
template:
src: wgfrp-setconf.conf.j2
dest: '/tmp/{{conn.name}}-setconf.conf'
register: 'wg_setconf_result'
when: 'not wg_enable_result.changed and not wg_conf_result.changed'
- name: '{{conn.name}}: wg setconf'
ignore_errors: true
shell: 'wg setconf {{conn.name}} /tmp/{{conn.name}}-setconf.conf'
when: 'not wg_enable_result.changed and not wg_conf_result.changed and wg_setconf_result.changed'
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