From 32bb8654386accbb5b2fd9ccea6ddc1021e51680 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Thu, 25 Feb 2016 17:49:50 +0100 Subject: [PATCH] Initial apt --- debian/apt/files/fbrehm.list | 6 +++++ debian/apt/files/salt.list | 1 + debian/apt/files/sources.list | 16 +++++++++++++ debian/apt/init.sls | 44 +++++++++++++++++++++++++++++++++++ debian/apt/map.jinja | 13 +++++++++++ top.sls | 10 ++++++++ 6 files changed, 90 insertions(+) create mode 100644 debian/apt/files/fbrehm.list create mode 100644 debian/apt/files/salt.list create mode 100644 debian/apt/files/sources.list create mode 100644 debian/apt/init.sls create mode 100644 debian/apt/map.jinja create mode 100644 top.sls diff --git a/debian/apt/files/fbrehm.list b/debian/apt/files/fbrehm.list new file mode 100644 index 0000000..f1785c7 --- /dev/null +++ b/debian/apt/files/fbrehm.list @@ -0,0 +1,6 @@ +# Packages Frank Brehm +# --------------------- + +#deb http://www.brehm-online.com/debian/{{ debian_release }} ./ +deb http://uhu8.uhu-banane.de/Debian/{{ debian_release }} ./ +deb-src http://uhu8.uhu-banane.de/Sources ./ diff --git a/debian/apt/files/salt.list b/debian/apt/files/salt.list new file mode 100644 index 0000000..7a56378 --- /dev/null +++ b/debian/apt/files/salt.list @@ -0,0 +1 @@ +deb http://repo.saltstack.com/apt/debian/8/amd64/latest {{ debian_release }} main diff --git a/debian/apt/files/sources.list b/debian/apt/files/sources.list new file mode 100644 index 0000000..90cdfd5 --- /dev/null +++ b/debian/apt/files/sources.list @@ -0,0 +1,16 @@ +# deb http://{{ debian_mirror }}/debian jessie main + +deb http://{{ debian_mirror }}/debian {{ debian_release }} main contrib non-free +deb-src http://{{ debian_mirror }}/debian {{ debian_release }} main contrib non-free + +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 + +# 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 + +# jessie-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 + diff --git a/debian/apt/init.sls b/debian/apt/init.sls new file mode 100644 index 0000000..36c468e --- /dev/null +++ b/debian/apt/init.sls @@ -0,0 +1,44 @@ +{%- from "debian/apt/map.jinja" import debian_release with context -%} +{%- from "debian/apt/map.jinja" import debian_mirror with context -%} + + +/etc/apt/sources.list.d: + file.directory: + - clean: True + +/etc/apt/sources.list: + file.managed: + - user: root + - group: root + - mode: 644 + - source: salt://debian/apt/files/sources.list + - template: jinja + - backup: minion + - defaults: + debian_release: {{ debian_release }} + debian_mirror: {{ debian_mirror }} + +/etc/apt/sources.list.d/salt.list: + file.managed: + - user: root + - group: root + - mode: 644 + - source: salt://debian/apt/files/salt.list + - template: jinja + - backup: minion + - defaults: + debian_release: {{ debian_release }} + debian_mirror: {{ debian_mirror }} + +/etc/apt/sources.list.d/fbrehm.list: + file.managed: + - user: root + - group: root + - mode: 644 + - source: salt://debian/apt/files/fbrehm.list + - template: jinja + - backup: minion + - defaults: + debian_release: {{ debian_release }} + debian_mirror: {{ debian_mirror }} + diff --git a/debian/apt/map.jinja b/debian/apt/map.jinja new file mode 100644 index 0000000..0646de8 --- /dev/null +++ b/debian/apt/map.jinja @@ -0,0 +1,13 @@ +{% if salt['grains.get']('osrelease')|int >= 8 %} + {% set debian_release = 'jessie' %} +{% elif salt['grains.get']('osrelease')|int >= 7 %} + {% 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' %} +{% else %} + {% set debian_mirror = 'ftp-stud.hs-esslingen.de' %} +{% endif %} diff --git a/top.sls b/top.sls new file mode 100644 index 0000000..4230482 --- /dev/null +++ b/top.sls @@ -0,0 +1,10 @@ +base: + 'ns2.uhu-banane.de': + - debian.apt +# - basic.rsync +# - basic.shells +# - basic.editors +# - basic.localization + + 'ns3.uhu-banane.de': + - debian.apt -- 2.39.5