proxy_role/tasks/Debian_post.yml
2024-01-06 03:08:22 +00:00

41 lines
1.4 KiB
YAML

# -*- mode: yaml; indent-tabs-mode: nil; tab-width: 2; coding: utf-8-unix -*-
---
- debug:
verbosity: 1
msg: "DEBUG: Including proxy Debian_post.yml SOCKS_PROXYHOST:SOCKS_PROXYPORT= {{SOCKS_PROXYHOST}}:{{SOCKS_PROXYPORT}}"
- 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 Debian_post.yml"
state: "{{'absent' if HTTP_PROXYHOST == '' else 'present' }}"
block: |
Acquire::http::Proxy "{{HTTP_PROXYTYPE}}://{{HTTP_PROXYHOST}}:{{HTTP_PROXYPORT}}";
Acquire::https::Proxy "{{HTTP_PROXYTYPE}}://{{HTTPS_PROXYHOST}}:{{HTTPS_PROXYPORT}}";
- name: /etc/apt/apt.conf.d/70testforge.conf
blockinfile:
dest: /etc/apt/apt.conf.d/70testforge.conf
create: yes
marker: "# {mark} ANSIBLE MANAGED BLOCK proxy proxy_post.yml"
state: "{{'absent' if HTTP_PROXYHOST == '' else 'present' }}"
block: |
Acquire::tor::proxy "socks5h://apt:apt@{{SOCKS_PROXYHOST}}:{{SOCKS_PROXYPORT}}";
Acquire::tor::Timeout 60;
when:
- "SOCKS_PROXYHOST != '' and SOCKS_PROXYPORT != ''"
- name: "/etc/sdwdate.d/30_default.conf"
lineinfile:
dest: /etc/sdwdate.d/30_default.conf
create: true
regexp: "^#*{{ item.name }}.*"
line: "{{ item.name }}={{ item.val }}"
with_items:
- { name: PROXY_IP, val: "{{SOCKS_PROXYHOST}}" }
- { name: PROXY_PORT, val: "{{SOCKS_PROXYPORT}}" }