blob: 7528acbc2fe922a4c66c58a467b844a448daa938 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
---
# File: /etc/ansible/roles/use-proxy/tasks/main.yml
- name: clear any ssh tunnel
shell: ps -ef | grep -iE -- "ss[h].*{{local_proxy_port}}" | awk '{print $2}' | xargs kill -9
ignore_errors: yes
- name: start ssh tunnel
shell: nohup ssh -N -p {{proxy_server_ssh_port}} {{proxy_server}} -L {{local_proxy_port}}/localhost/{{proxy_port}} &
notify: stop ssh tunnel
## execute task with the proxy
#- name: execute task
# get_url:
# dest: /tmp/
# url: http://albion320.no-ip.biz/smith122/repo/
# register: env
# environment: "{{proxy_env}}"
#- debug:
# var: env
|