Debian Codegraph @

test/integration/targets/uri/tasks/unix-socket.yml

raw
1 - name: Bind socat to socket
2 command: socat UNIX-LISTEN:{{ remote_tmp_dir }}/{{ item.name }}.sock,fork,reuseaddr TCP4:{{ httpbin_host }}:{{ item.port }}
3 loop:
4 - port: 80
5 name: http
6 - port: 443
7 name: https
8 async: 10
9 poll: 0
10
11 - name: Test http connection to unix socket
12 uri:
13 url: http://localhost/get
14 unix_socket: '{{ remote_tmp_dir }}/http.sock'
15 register: unix_socket_http
16
17 - name: Test https connection to unix socket with validate_certs=false
18 uri:
19 url: https://localhost/get
20 unix_socket: '{{ remote_tmp_dir }}/https.sock'
21 # Ignore ssl verification since we list the host as localhost
22 # to ensure we really are connecting over the socket
23 validate_certs: false
24 register: unix_socket_https_no_validate
25
26 - name: Test https connection to unix socket
27 uri:
28 url: https://{{ httpbin_host }}/get
29 unix_socket: '{{ remote_tmp_dir }}/https.sock'
30 register: unix_socket_https
31
32 - assert:
33 that:
34 - unix_socket_http.json is defined
35 - unix_socket_https_no_validate.json is defined
36 - unix_socket_https.json is defined