-# deb http://{{ debian_mirror }}/debian jessie main
+{%- if loc_provider == 'hetzner' -%}
+deb http://mirror.hetzner.de/debian/packages {{ debian_release }} main contrib non-free
+deb http://mirror.hetzner.de/debian/security {{ debian_release }}/updates main contrib non-free
-deb http://{{ debian_mirror }}/debian {{ debian_release }} main contrib non-free
-deb-src http://{{ debian_mirror }}/debian {{ debian_release }} main contrib non-free
+{% endif -%}
-deb http://security.debian.org/ {{ debian_release }}/updates main contrib non-free
-deb-src http://security.debian.org/ {{ debian_release }}/updates main contrib non-free
+# deb http://{{ debian_mirror }}/debian {{ debian_release }} main
-# jessie-updates, previously known as 'volatile'
-deb http://{{ debian_mirror }}/debian {{ debian_release }}-updates main contrib non-free
-deb-src http://{{ debian_mirror }}/debian {{ debian_release }}-updates main contrib non-free
+# main {{ debian_release }} repositories
+deb http://{{ debian_mirror }}/debian {{ debian_release }} main contrib non-free
+deb-src http://{{ debian_mirror }}/debian {{ debian_release }} main contrib non-free
-# jessie-backports, previously on backports.debian.org
+# {{ debian_release }} security updates
+deb http://security.debian.org/ {{ debian_release }}/updates main contrib non-free
+deb-src http://security.debian.org/ {{ debian_release }}/updates main contrib non-free
+
+# {{ debian_release }}-updates, previously known as 'volatile'
+deb http://{{ debian_mirror }}/debian {{ debian_release }}-updates main contrib non-free
+deb-src http://{{ debian_mirror }}/debian {{ debian_release }}-updates main contrib non-free
+
+# {{ debian_release }}-backports, previously on backports.debian.org
deb http://{{ debian_mirror }}/debian/ {{ debian_release }}-backports main contrib non-free
deb-src http://{{ debian_mirror }}/debian/ {{ debian_release }}-backports main contrib non-free
+# vim: noet ts=8
{%- from "debian/apt/map.jinja" import debian_release with context -%}
{%- from "debian/apt/map.jinja" import debian_mirror with context -%}
+{%- from "debian/apt/map.jinja" import loc_country with context -%}
+{%- from "debian/apt/map.jinja" import loc_provider with context -%}
+{%- from "debian/apt/map.jinja" import loc_dc with context -%}
/etc/apt/SALTSTACK-GPG-KEY.pub:
file.managed:
- defaults:
debian_release: {{ debian_release }}
debian_mirror: {{ debian_mirror }}
+ loc_country: {{ loc_country }}
+ loc_provider: {{ loc_provider }}
+ loc_dc: {{ loc_dc }}
/etc/apt/sources.list.d:
file.directory:
{% set debian_release = 'wheezy' %}
{% endif %}
-{% if salt['grains.get']('fqdn') == 'ns2.uhu-banane.de' %}
- {% set debian_mirror = 'ftp.us.debian.org' %}
-{% elif salt['grains.get']('fqdn') == 'ns3.uhu-banane.de' %}
- {% set debian_mirror = 'ftp.plusline.de' %}
+{% set loc_country = salt['pillar.get']('location:country', 'de') %}
+{% set loc_provider = salt['pillar.get']('location:provider', 'profitbricks') %}
+{% set loc_dc = salt['pillar.get']('location:dc', 'unknown') %}
+
+{% if loc_country == 'us' %}
+ {% set debian_mirror = 'ftp.us.debian.org' %}
{% else %}
+ {% if loc_provider == 'gridscale' %}
+ {% set debian_mirror = 'ftp.plusline.de' %}
+ {% else %}
{% set debian_mirror = 'ftp-stud.hs-esslingen.de' %}
+ {% endif %}
{% endif %}
+