Change proxy Jinja logic (none and empty string are falsy)

This commit is contained in:
William Wernert
2021-03-08 17:36:34 -05:00
parent f85f86ccdd
commit ba71b2fbc8
2 changed files with 2 additions and 2 deletions

View File

@@ -72,7 +72,7 @@ so-idstools:
- image: {{ MANAGER }}:5000/{{ IMAGEREPO }}/so-idstools:{{ VERSION }} - image: {{ MANAGER }}:5000/{{ IMAGEREPO }}/so-idstools:{{ VERSION }}
- hostname: so-idstools - hostname: so-idstools
- user: socore - user: socore
{% if proxy != '' and proxy is not none %} {% if proxy %}
- environment: - environment:
- http_proxy={{ proxy }} - http_proxy={{ proxy }}
- https_proxy={{ proxy }} - https_proxy={{ proxy }}

View File

@@ -14,6 +14,6 @@ distroverpkg=centos-release
clean_requirements_on_remove=1 clean_requirements_on_remove=1
{% if (grains['role'] not in ['so-eval','so-managersearch', 'so-manager', 'so-standalone']) and salt['pillar.get']('global:managerupdate', '0') -%} {% if (grains['role'] not in ['so-eval','so-managersearch', 'so-manager', 'so-standalone']) and salt['pillar.get']('global:managerupdate', '0') -%}
proxy=http://{{ salt['pillar.get']('yum:config:proxy', salt['config.get']('master')) }}:3142 proxy=http://{{ salt['pillar.get']('yum:config:proxy', salt['config.get']('master')) }}:3142
{% elif proxy != '' and proxy is not none -%} {% elif proxy -%}
proxy={{ proxy }} proxy={{ proxy }}
{% endif %} {% endif %}