Skip to content

Add ubuntu map.jinja #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 28, 2019
Merged
Changes from 3 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
59 changes: 54 additions & 5 deletions apt/map.jinja
Original file line number Diff line number Diff line change
@@ -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': {
Expand All @@ -21,18 +20,68 @@
'default_url': 'http://deb.debian.org/debian/',
'default_keyring_package': 'debian-archive-keyring',
'repositories': {
'sane_default': {
'default': {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jdkelleher Although I prefer the names you set more than the old ones, changing these will be backward incompatible for users of this formula in the case that the formula was used as-is (with no pillar data): the existing repos sane_default-binary.list and security-stable-binary.list will still exist and the new ones (default-binary.list and default-security-binary.list) will be created, giving a warning that the entries are duplicated.

I'd suggest you keep the old names for the Debian part, so your PR is backward compatible and can be merged. We can later submit another PR to rename these and allow to delete specific entries (which is not currently supported).

wdyt?

Copy link
Contributor Author

@jdkelleher jdkelleher May 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes perfect sense to me. I was thinking about the entry deletion gap when I was making updates, but moved forward without a solution.

Should I update and resubmit or is there a cleaner way to bring that into this branch?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@javierbertoli I just committed the requested updates. Please let me know if anything else is needed. Thanks.

'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') %}