Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion roles/apt/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
debian_source: "http://deb.debian.org/debian/"
debian_version: stretch
apt_proxy: ""
apt_proxy: false
update_apt_sources: false
enable_sid: false
17 changes: 2 additions & 15 deletions roles/apt/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,8 @@
with_fileglob:
- files/apt.conf.d/*

# d-i puts the apt config in apt.conf, but we prefer a .d file
- name: ensure apt proxy isn't in apt.conf
lineinfile:
dest: /etc/apt/apt.conf
regexp: ^Acquire::http::Proxy
state: absent

- name: setup apt proxy
template:
src: templates/30apt-proxy.j2
dest: /etc/apt/apt.conf.d/30apt-proxy
when: apt_proxy != ""

- name: unconfigure apt proxy
- name: unconfigure apt proxy that D-I set
file:
path: /etc/apt/apt.conf.d/30apt-proxy
state: absent
when: apt_proxy == ""
when: not apt_proxy
2 changes: 0 additions & 2 deletions roles/apt/templates/30apt-proxy.j2

This file was deleted.

2 changes: 1 addition & 1 deletion roles/tftp-server/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ late_command_url: https://anonscm.debian.org/cgit/debconf-video/ansible.git/plai
time_zone: UTC
domain: video.debconf.org

apt_proxy: ""
apt_proxy: false
# Defaults to deb.debian.org | archive.ubuntu.com
#mirror: deb.debian.org

Expand Down
4 changes: 3 additions & 1 deletion roles/tftp-server/templates/preseed.cfg.j2
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ d-i mirror/http/directory string /debian
d-i mirror/http/hostname string {{ mirror | default('archive.ubuntu.com') }}
d-i mirror/http/directory string /ubuntu
{% endif %}
d-i mirror/http/proxy string {{ apt_proxy }}
{% if apt_proxy %}
d-i mirror/http/proxy string http://{{ inventory_hostname }}:8000/
{% endif %}

# Suite to install.
#d-i mirror/suite string testing
Expand Down