Commit 8d17051f authored by nanahira's avatar nanahira

updates

parent e0f9949b
......@@ -76,6 +76,7 @@
docker_compose:
project_src: '{{ansible_user_dir}}/nextgen-network/services'
remove_orphans: true
pull: true
handlers:
- name: reload_switch_rules
become: true
......
- name: '{{conn.name}}: stop wireguard'
become: true
ignore_errors: true
systemd:
name: 'wg-quick@{{conn.name}}'
state: stopped
enabled: no
- name: '{{conn.name}}: remove wg config files'
file:
path: '/etc/wireguard/{{conn.name}}.conf'
state: absent
# 因为测试期间频繁改动参数,这里手动down掉
# 调试wg的时候开这个,调试别的的时候注释掉
- name: '{{conn.name}}: wg conf'
become: true
template:
src: wg.conf.j2
dest: '/etc/wireguard/{{conn.name}}.conf'
register: wg_conf_result
- name: '{{conn.name}}: enable wg'
become: true
systemd:
name: 'wg-quick@{{conn.name}}'
state: started
......@@ -13,19 +15,21 @@
ignore_errors: true
register: 'wg_enable_result'
- name: '{{conn.name}}: restart wg'
become: true
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'
become: true
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'
become: true
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'
when: 'wg_setconf_result.changed'
......@@ -8,11 +8,13 @@
# wg
- name: '{{conn.name}}: wg conf'
become: true
template:
src: wgfrp.conf.j2
dest: '/etc/wireguard/{{conn.name}}.conf'
register: wg_conf_result
- name: '{{conn.name}}: start wg'
become: true
systemd:
name: 'wg-quick@{{conn.name}}'
state: started
......@@ -20,19 +22,21 @@
ignore_errors: true
register: wg_enable_result
- name: '{{conn.name}}: restart wg'
become: true
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'
become: true
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'
become: true
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'
when: 'wg_setconf_result.changed'
......@@ -10,9 +10,9 @@ set -e
mkdir -p result
npm start
cd lists
./run.sh
cd ..
#cd lists
#./run.sh
#cd ..
cd ansible || exit
......
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