apt_sources: check ob >0 in template statt Task (#300)

Co-authored-by: Michael Grote <michael.grote@posteo.de>
Reviewed-on: mg/ansible#300
Co-authored-by: mg <michael.grote@posteo.de>
Co-committed-by: mg <michael.grote@posteo.de>
This commit is contained in:
Michael Grote 2022-01-15 11:18:56 +01:00
parent a1864ad80d
commit c73037ce5c
2 changed files with 5 additions and 3 deletions

View file

@ -3,16 +3,16 @@
include_tasks: ubuntu.yml include_tasks: ubuntu.yml
when: when:
- ansible_distribution == 'Ubuntu' - ansible_distribution == 'Ubuntu'
- manage_sources_apt_proxy | length > 0 - manage_sources_apt_proxy is defined
- name: include Linux Mint tasks (determined by "ansible_distribution") - name: include Linux Mint tasks (determined by "ansible_distribution")
include_tasks: mint.yml include_tasks: mint.yml
when: when:
- ansible_distribution == 'Linux Mint' - ansible_distribution == 'Linux Mint'
- manage_sources_apt_proxy | length > 0 - manage_sources_apt_proxy is defined
- name: include proxmox tasks (determined by group) - name: include proxmox tasks (determined by group)
include_tasks: proxmox.yml include_tasks: proxmox.yml
when: when:
- "'proxmox' in group_names" - "'proxmox' in group_names"
- manage_sources_apt_proxy | length > 0 - manage_sources_apt_proxy is defined

View file

@ -1,3 +1,5 @@
{{ file_header | default () }} {{ file_header | default () }}
{% if manage_sources_apt_proxy | length > 0 %}
Acquire::http::proxy "http://{{ manage_sources_apt_proxy | default() }}"; Acquire::http::proxy "http://{{ manage_sources_apt_proxy | default() }}";
Acquire::https::proxy "http://{{ manage_sources_apt_proxy | default() }}"; Acquire::https::proxy "http://{{ manage_sources_apt_proxy | default() }}";
{% endif %}