Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions ansible/roles/proxy/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
- name: Validate http_proxy definition
ansible.builtin.assert:
that: proxy_http_proxy != '' # this is default if squid not active
that: proxy_http_proxy != ''
fail_msg: >-
Variable proxy_http_proxy cannot be the empty string for hosts in the
proxy group. See environment/common/inventory/group_vars/all/proxy.yml.
proxy group. See environments/common/inventory/group_vars/all/proxy.yml
for convenience variables to set this.
- name: Define configuration in /etc/environment
tags: proxy
lineinfile:
Expand Down
8 changes: 4 additions & 4 deletions environments/common/inventory/group_vars/all/proxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ proxy_remove: false

# full http proxy string - override if the above don't provide enough control:
proxy_http_proxy: >-
{% if groups['squid'] | length > 0 %}
{%- if proxy_http_address != '' -%}
http://
{%- if proxy_basic_password -%}
{{ proxy_basic_user }}:{{ proxy_basic_password }}@
{%- endif -%}
{{ proxy_http_address }}:{{ proxy_http_port }}
{% else %}
{% endif %}
{%- else %}

{%- endif %}