From 30d734117a39bb964bd6c08aac66851ab0aac67e Mon Sep 17 00:00:00 2001 From: TLKA-TW-Technik <89380235+TLKA-TW-Technik@users.noreply.github.com> Date: Mon, 23 Aug 2021 09:50:10 +0200 Subject: [PATCH 1/4] added feature parameter for apt proxy handling --- ansible/group_vars/all.example | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ansible/group_vars/all.example b/ansible/group_vars/all.example index a8178beb..827d0ea5 100644 --- a/ansible/group_vars/all.example +++ b/ansible/group_vars/all.example @@ -310,3 +310,6 @@ system_email_recipient: # `enableMOTD` to the value `false` or uncomment the line afterwards ( default # value is `true`). # enableMOTD: false + +# To enable proxy usage for APT, please uncomment the line below. +# ENABLE_PROXY_FOR_APT: "true" From a846813e89dd37f87afb4f416f401ab80fa5297b Mon Sep 17 00:00:00 2001 From: TLKA-TW-Technik <89380235+TLKA-TW-Technik@users.noreply.github.com> Date: Mon, 23 Aug 2021 10:02:34 +0200 Subject: [PATCH 2/4] added feature apt proxy handling --- ansible/roles/common/tasks/main.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ansible/roles/common/tasks/main.yml b/ansible/roles/common/tasks/main.yml index ffcb5000..f6bcd667 100644 --- a/ansible/roles/common/tasks/main.yml +++ b/ansible/roles/common/tasks/main.yml @@ -1,6 +1,8 @@ --- - name: Configure proxy for apt - when: http_proxy is defined + when: + - http_proxy is defined + - USE_APNS_STANDARD_PORT == true template: src=apt.proxy.conf.j2 dest=/etc/apt/apt.conf.d/01proxy - name: Remove apt proxy configuration when no proxy is configured From fd98c316d005e1c0eb7f7308520a8e21ebf555b8 Mon Sep 17 00:00:00 2001 From: TLKA-TW-Technik <89380235+TLKA-TW-Technik@users.noreply.github.com> Date: Mon, 23 Aug 2021 10:04:59 +0200 Subject: [PATCH 3/4] added feature apt proxy handling --- ansible/roles/common/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/roles/common/tasks/main.yml b/ansible/roles/common/tasks/main.yml index f6bcd667..49c76b95 100644 --- a/ansible/roles/common/tasks/main.yml +++ b/ansible/roles/common/tasks/main.yml @@ -6,7 +6,7 @@ template: src=apt.proxy.conf.j2 dest=/etc/apt/apt.conf.d/01proxy - name: Remove apt proxy configuration when no proxy is configured - when: http_proxy is not defined + when: USE_APNS_STANDARD_PORT == false or http_proxy is not defined file: dest=/etc/apt/apt.conf.d/01proxy state=absent # Installing dnsmasq is a chicken/egg problem: the apt cache must be updated From 3adb3063f30d899f1bb1f8bdff1300178ae9f62c Mon Sep 17 00:00:00 2001 From: TLKA-TW-Technik <89380235+TLKA-TW-Technik@users.noreply.github.com> Date: Mon, 23 Aug 2021 10:37:17 +0200 Subject: [PATCH 4/4] Fixed variable name on task --- ansible/roles/common/tasks/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ansible/roles/common/tasks/main.yml b/ansible/roles/common/tasks/main.yml index 49c76b95..d6a02a98 100644 --- a/ansible/roles/common/tasks/main.yml +++ b/ansible/roles/common/tasks/main.yml @@ -2,11 +2,11 @@ - name: Configure proxy for apt when: - http_proxy is defined - - USE_APNS_STANDARD_PORT == true + - ENABLE_PROXY_FOR_APT == true template: src=apt.proxy.conf.j2 dest=/etc/apt/apt.conf.d/01proxy - name: Remove apt proxy configuration when no proxy is configured - when: USE_APNS_STANDARD_PORT == false or http_proxy is not defined + when: ENABLE_PROXY_FOR_APT == false or http_proxy is not defined file: dest=/etc/apt/apt.conf.d/01proxy state=absent # Installing dnsmasq is a chicken/egg problem: the apt cache must be updated