Skip to content

Commit

Permalink
Use var for http_proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
sivel committed Apr 22, 2024
1 parent 6d6b0f4 commit b484277
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
4 changes: 4 additions & 0 deletions test/integration/targets/setup_proxy/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,7 @@
slurp:
path: '{{ remote_tmp_dir }}/proxy_py/proxy_py.pid'
register: proxy_py_pid

- name: set fact for proxy host
set_fact:
http_proxy: 'http://127.0.0.1:8080'
18 changes: 9 additions & 9 deletions test/integration/targets/uri/tasks/proxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
uri:
url: http://{{ httpbin_host }}/get
environment:
http_proxy: http://127.0.0.1:8080
http_proxy: '{{ http_proxy }}'
register: http_over_http
failed_when: http_over_http.x_sandwich is undefined

- name: Test https over http proxy
uri:
url: https://{{ httpbin_host }}/get
environment:
https_proxy: http://127.0.0.1:8080
https_proxy: '{{ http_proxy }}'
register: https_over_http
# failed_when:
# failure checking is handled by the assert at the bottom comparing logs
Expand All @@ -35,7 +35,7 @@
uri:
url: http://{{ httpbin_host }}/get
environment:
http_proxy: http://127.0.0.1:8080
http_proxy: '{{ http_proxy }}'
no_proxy: '{{ httpbin_host }}'
register: no_proxy_hostname
failed_when: no_proxy_hostname.x_sandwich is defined
Expand All @@ -44,7 +44,7 @@
uri:
url: http://{{ httpbin_ip.stdout }}/get
environment:
http_proxy: http://127.0.0.1:8080
http_proxy: '{{ http_proxy }}'
no_proxy: '{{ httpbin_ip.stdout }}'
register: no_proxy_ip
failed_when: no_proxy_ip.x_sandwich is defined
Expand All @@ -53,7 +53,7 @@
uri:
url: http://{{ httpbin_ip.stdout }}/get
environment:
http_proxy: http://127.0.0.1:8080
http_proxy: '{{ http_proxy }}'
no_proxy: '{{ httpbin_ip.stdout }}/32'
register: no_proxy_cidr_32
failed_when: no_proxy_cidr_32.x_sandwich is defined
Expand All @@ -62,7 +62,7 @@
uri:
url: http://{{ httpbin_ip.stdout }}/get
environment:
http_proxy: http://127.0.0.1:8080
http_proxy: '{{ http_proxy }}'
no_proxy: '{{ httpbin_cidr }}'
register: no_proxy_cidr_24
vars:
Expand All @@ -73,7 +73,7 @@
uri:
url: http://{{ httpbin_ip.stdout }}/get
environment:
http_proxy: http://127.0.0.1:8080
http_proxy: '{{ http_proxy }}'
no_proxy: 1.2.3.0/24
register: no_proxy_non_matching_cidr
failed_when: no_proxy_non_matching_cidr.x_sandwich is undefined
Expand All @@ -82,7 +82,7 @@
uri:
url: http://{{ httpbin_ip.stdout }}/get
environment:
http_proxy: http://127.0.0.1:8080
http_proxy: '{{ http_proxy }}'
no_proxy: '{{ httpbin_ip.stdout }}/32:80'
register: no_proxy_cidr_port
failed_when: no_proxy_cidr_port.x_sandwich is defined
Expand All @@ -91,7 +91,7 @@
uri:
url: http://{{ httpbin_ip.stdout }}/get
environment:
http_proxy: http://127.0.0.1:8080
http_proxy: '{{ http_proxy }}'
no_proxy: '{{ httpbin_ip.stdout }}/32:8080'
register: no_proxy_non_matching_cidr_port
failed_when: no_proxy_non_matching_cidr_port.x_sandwich is undefined
Expand Down

0 comments on commit b484277

Please sign in to comment.