-
Notifications
You must be signed in to change notification settings - Fork 419
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(package): use apt-pinning to pin specific package version
Available only on Debian family OS-es
- Loading branch information
Showing
5 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
--- | ||
salt: | ||
version: '' | ||
pin_version: false | ||
py_ver: '' ## py2 is default | ||
rootuser: root | ||
rootgroup: root | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{%- set tplroot = tpldir.split('/')[0] %} | ||
{%- from tplroot ~ "/map.jinja" import salt_settings with context %} | ||
{% if salt_settings.pin_version and salt_settings.version and grains.os_family|lower == 'debian' %} | ||
salt-pin-version: | ||
file.managed: | ||
- name: /etc/apt/preferences.d/salt | ||
- contents: | | ||
# This file managed by Salt, do not edit by hand!! | ||
Package: salt* | ||
Pin: version {{ salt_settings.version }} | ||
Pin-Priority: 1000 | ||
# Order: 2 because we can't put a require_in on "pkg: salt-{master,minion}" | ||
# because we don't know if they are used, and 'order: 1' already occupied by salt-pkgrepo | ||
- order: 2 | ||
{% elif grains.os_family|lower != 'debian' %} | ||
salt-pin-version: | ||
test.show_notification: | ||
- name: Available on Debian family OS-es only | ||
- text: Apt pinning available only on Debian based distributives | ||
{% endif %} |