diff options
Diffstat (limited to 'roles/shadowsocks/tasks')
-rw-r--r-- | roles/shadowsocks/tasks/main.yml | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/roles/shadowsocks/tasks/main.yml b/roles/shadowsocks/tasks/main.yml new file mode 100644 index 0000000..5065085 --- /dev/null +++ b/roles/shadowsocks/tasks/main.yml @@ -0,0 +1,32 @@ +--- +- name: install shadowsocks-libev + pkgng: + name: shadowsocks-libev + state: present + +- name: setup configuration file + template: + src: config.json.j2 + dest: /usr/local/etc/shadowsocks-libev/config.json + mode: 0640 + notify: restart-shadowsocks + +- name: enable and start service + command: rcenable shadowsocks-libev + +- name: show client-side config + vars: + config: | + "{" + "server": "{{ ansible_ssh_host }}", + "server_port": {{ shadowsocks.server_port }}, + "local_port": 1080, + "password": "{{ shadowsocks.password }}", + "method": "{{ shadowsocks.method }}", + "timeout": 600, + "fast_open": true, + "reuse_port": true, + "no_delay": true + "}" + debug: + msg: "{{ config.split('\n') }}" |