Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
salt-formula
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
salt
salt-formula
Commits
98ad87a0
Commit
98ad87a0
authored
5 years ago
by
hatifnatt
Browse files
Options
Downloads
Patches
Plain Diff
feat(package): use apt-pinning to pin specific package version
Available only on Debian family OS-es
parent
e47acb48
No related branches found
No related tags found
No related merge requests found
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
pillar.example
+4
-0
4 additions, 0 deletions
pillar.example
salt/defaults.yaml
+1
-0
1 addition, 0 deletions
salt/defaults.yaml
salt/master.sls
+5
-0
5 additions, 0 deletions
salt/master.sls
salt/minion.sls
+5
-0
5 additions, 0 deletions
salt/minion.sls
salt/pin.sls
+22
-0
22 additions, 0 deletions
salt/pin.sls
with
37 additions
and
0 deletions
pillar.example
+
4
−
0
View file @
98ad87a0
...
...
@@ -24,6 +24,10 @@ salt:
# Optional: set salt version (if install_packages is set to true)
version
:
2017.7.2-1.el7
# Pin version provided under 'version' key by using apt-pinning
# available only on Debian family OS-es
pin_version
:
false
# to overwrite map.jinja salt packages
lookup
:
salt_master
:
'
salt-master'
...
...
This diff is collapsed.
Click to expand it.
salt/defaults.yaml
+
1
−
0
View file @
98ad87a0
...
...
@@ -3,6 +3,7 @@
---
salt
:
version
:
'
'
pin_version
:
false
py_ver
:
'
'
## py2 is default
rootuser
:
root
rootgroup
:
root
...
...
This diff is collapsed.
Click to expand it.
salt/master.sls
+
5
−
0
View file @
98ad87a0
...
...
@@ -2,6 +2,11 @@
{%- from tplroot ~ "/map.jinja" import salt_settings with context %}
{%- from tplroot ~ "/libtofs.jinja" import files_switch with context %}
{% if salt_settings.pin_version and salt_settings.version and grains.os_family|lower == 'debian' %}
include:
- .pin
{% endif %}
salt-master:
{% if salt_settings.install_packages %}
pkg.installed:
...
...
This diff is collapsed.
Click to expand it.
salt/minion.sls
+
5
−
0
View file @
98ad87a0
...
...
@@ -2,6 +2,11 @@
{%- from tplroot ~ "/map.jinja" import salt_settings with context %}
{%- from tplroot ~ "/libtofs.jinja" import files_switch with context %}
{% if salt_settings.pin_version and salt_settings.version and grains.os_family|lower == 'debian' %}
include:
- .pin
{% endif %}
{% if salt_settings.install_packages and grains.os == 'MacOS' %}
download-salt-minion:
{% if salt_settings.salt_minion_pkg_source %}
...
...
This diff is collapsed.
Click to expand it.
salt/pin.sls
0 → 100644
+
22
−
0
View file @
98ad87a0
{%- 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 %}
This diff is collapsed.
Click to expand it.
Jan Philipp Timme
@timmej
mentioned in commit
4a83d7dc
·
4 years ago
mentioned in commit
4a83d7dc
mentioned in commit 4a83d7dc305f0cd98b5ac28d9f18c42ebd3b999e
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment