Continue eliminating hardcoded apt-proxy.

This commit is contained in:
Andreas B. Mundt 2022-06-26 12:59:09 +02:00 committed by Andreas B. Mundt
parent 280f42ae0b
commit 93f9565c55
3 changed files with 5 additions and 11 deletions

View file

@ -51,15 +51,11 @@
pre_tasks: pre_tasks:
- name: install apt-cacher-ng - name: install apt-cacher-ng
apt: apt:
name: apt-cacher-ng name:
- apt-cacher-ng
- auto-apt-proxy
state: latest # noqa package-latest state: latest # noqa package-latest
- name: enable apt-cacher-ng
lineinfile:
path: /etc/apt/apt.conf.d/30proxy
line: 'Acquire::http::Proxy "http://localhost:3142/";'
create: true
- name: enable and start systemd-networkd on the host - name: enable and start systemd-networkd on the host
systemd: systemd:
name: systemd-networkd name: systemd-networkd

View file

@ -1 +0,0 @@
Acquire::http::Proxy "http://localhost:3142";

View file

@ -5,6 +5,7 @@
name: name:
- systemd-container - systemd-container
- debootstrap - debootstrap
- auto-apt-proxy
state: latest # noqa package-latest state: latest # noqa package-latest
- name: prepare machine directory - name: prepare machine directory
@ -16,15 +17,13 @@
- name: debootstrap base system - name: debootstrap base system
command: command:
cmd: > cmd: >
debootstrap auto-apt-proxy debootstrap
--include={{ cont_packages | union(cont_packages_extra) | join(',') }} --include={{ cont_packages | union(cont_packages_extra) | join(',') }}
--components=main,contrib,non-free stable --components=main,contrib,non-free stable
{{ contname }}00 http://deb.debian.org/debian {{ contname }}00 http://deb.debian.org/debian
args: args:
chdir: /var/lib/machines/ chdir: /var/lib/machines/
creates: /var/lib/machines/{{ contname }}00 creates: /var/lib/machines/{{ contname }}00
environment:
http_proxy: "{{ '' if run_in_installer|default(false) else 'http://localhost:3142' }}"
notify: enable and restart containers notify: enable and restart containers
- name: provide complete apt sources - name: provide complete apt sources