From f4657b324cdae4d72162c353eccb7517f7c1b40b Mon Sep 17 00:00:00 2001 From: Moritz Holtz Date: Fri, 19 Jul 2019 20:12:23 +0200 Subject: [PATCH] added setting of aptproxy var apt.proxy, only deployed if set in host/groupvars --- tasks/main.yml | 6 ++++++ templates/50proxy.j2 | 2 ++ 2 files changed, 8 insertions(+) create mode 100644 templates/50proxy.j2 diff --git a/tasks/main.yml b/tasks/main.yml index 9ced492..1bbf41d 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -13,6 +13,12 @@ - name: install apt-transport-https apt: pkg=apt-transport-https +- name: setup apt proxy + template: + src: 50proxy.j2 + dest: /etc/apt/apt.conf.d/50proxy + when: apt.proxy is defined + - name: setup repositories include_tasks: repo.yml with_items: "{{ packages.repos }}" diff --git a/templates/50proxy.j2 b/templates/50proxy.j2 new file mode 100644 index 0000000..0a80c9a --- /dev/null +++ b/templates/50proxy.j2 @@ -0,0 +1,2 @@ +Acquire::http::Proxy "http://{{ apt.proxy }}"; +Acquire::https::Proxy "https://{{ apt.proxy }}";