From 373c7ef35a8cce41ea2c42bf03eef68f202eeb60 Mon Sep 17 00:00:00 2001 From: "Jason D. Kelleher" Date: Mon, 27 May 2019 11:40:29 -0400 Subject: [PATCH 1/2] added Ubuntu entries to map.jinja updated repositories entries for sane naming across Debian and Ubuntu entries updated repo entries for security as syntax differs between Debian and Ubuntu added repo entries for -updates (previously known as volatile) updated map to use explicitly use grain os instead of implicitly use os_family removed distribution_updates variable - syntax was Debian specific and invailid for Ubuntu tested against Debian/stretch and Ubuntu/xenial --- apt/map.jinja | 59 ++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 54 insertions(+), 5 deletions(-) diff --git a/apt/map.jinja b/apt/map.jinja index 1e23205..e8f4c25 100644 --- a/apt/map.jinja +++ b/apt/map.jinja @@ -1,5 +1,4 @@ {% set distribution = salt['grains.get']('lsb_distrib_codename') %} -{% set distribution_updates = salt['grains.get']('lsb_distrib_codename') ~ '/updates' %} {% set arch = salt['grains.get']('osarch').split(' ') %} {% set apt = salt['grains.filter_by']({ 'Debian': { @@ -21,18 +20,68 @@ 'default_url': 'http://deb.debian.org/debian/', 'default_keyring_package': 'debian-archive-keyring', 'repositories': { - 'sane_default': { + 'default': { 'distro': distribution, 'url': 'http://deb.debian.org/debian/', 'arch': arch, 'comps': ['main'], }, - 'security-stable': { - 'distro': distribution_updates, + 'default-security': { + 'distro': distribution ~ '/updates', 'url': 'http://security.debian.org/', 'arch': arch, 'comps': ['main'], }, + 'default-updates': { + 'distro': distribution ~ '-updates', + 'url': 'http://deb.debian.org/debian/', + 'arch': arch, + 'comps': ['main'], + }, + }, + }, + + 'Ubuntu': { + 'pkgs': ['unattended-upgrades'], + 'confd_dir': '/etc/apt/apt.conf.d', + 'unattended_config': '50unattended-upgrades', + 'periodic_config': '10periodic', + 'sources_list_dir': '/etc/apt/sources.list.d', + 'remove_sources_list': false, + 'clean_sources_list_d': false, + 'preferences_dir': '/etc/apt/preferences.d', + 'preferences': {}, + 'remove_preferences': false, + 'clean_preferences_d': false, + 'remove_apt_conf': false, + 'clean_apt_conf_d': false, + 'apt_conf_d': {}, + 'default_keyserver': 'keyserver.ubuntu.com', + 'default_url': 'http://archive.ubuntu.com/ubuntu/', + 'default_keyring_package': 'ubuntu-keyring', + 'repositories': { + 'default': { + 'distro': distribution, + 'url': 'http://archive.ubuntu.com/ubuntu/', + 'arch': arch, + 'comps': ['main'], + }, + 'default-security': { + 'distro': distribution ~ '-security', + 'url': 'http://security.ubuntu.com/ubuntu/', + 'arch': arch, + 'comps': ['main'], + }, + + 'default-updates': { + 'distro': distribution ~ '-updates', + 'url': 'http://archive.ubuntu.com/ubuntu/', + 'arch': arch, + 'comps': ['main'], + }, + }, }, -}, merge=salt['pillar.get']('apt:lookup'), default='Debian') %} + +}, grain='os', merge=salt['pillar.get']('apt:lookup'), default='Debian') %} + From 380848796c96eacf39e03664b90cde4b8472a15c Mon Sep 17 00:00:00 2001 From: "Jason D. Kelleher" Date: Mon, 27 May 2019 21:39:00 -0400 Subject: [PATCH 2/2] incorporated change request from javierbertoli for backwards compatibility --- apt/map.jinja | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apt/map.jinja b/apt/map.jinja index e8f4c25..528675b 100644 --- a/apt/map.jinja +++ b/apt/map.jinja @@ -20,13 +20,13 @@ 'default_url': 'http://deb.debian.org/debian/', 'default_keyring_package': 'debian-archive-keyring', 'repositories': { - 'default': { + 'sane_default': { 'distro': distribution, 'url': 'http://deb.debian.org/debian/', 'arch': arch, 'comps': ['main'], }, - 'default-security': { + 'security-stable': { 'distro': distribution ~ '/updates', 'url': 'http://security.debian.org/', 'arch': arch,