proxy_role/tasks/Ubuntu_post.yml

24 lines
690 B
YAML
Raw Permalink Normal View History

2024-01-06 03:08:22 +00:00
# -*- mode: yaml; indent-tabs-mode: nil; tab-width: 2; coding: utf-8-unix -*-
---
- debug:
verbosity: 1
msg: "DEBUG: Including proxy Ubuntu_post.yml"
- name: /etc/apt/apt.conf.d/80proxy.conf
blockinfile:
dest: /etc/apt/apt.conf.d/80proxy.conf
create: yes
marker: "# {mark} ANSIBLE MANAGED BLOCK proxy"
block: |
Acquire::http::Proxy "{{HTTP_PROXYTYPE}}://{{HTTP_PROXYHOST}}:{{HTTP_PROXYPORT}}";
Acquire::https::Proxy "{{HTTP_PROXYTYPE}}://{{HTTPS_PROXYHOST}}:{{HTTPS_PROXYPORT}}";
when: HTTP_PROXYHOST != ''
- name: /etc/apt/apt.conf.d/80proxy.conf
file:
path: /etc/apt/apt.conf.d/80proxy.conf
state: absent
when: HTTP_PROXYHOST == ''