From 6027df00a473c22884f89c3879929208a65d3b7e Mon Sep 17 00:00:00 2001 From: Iustina Date: Thu, 1 Feb 2018 12:13:55 +0200 Subject: [PATCH] Add configuration for packages version --- pillar.example | 3 +++ salt/api.sls | 3 +++ salt/cloud.sls | 3 +++ salt/master.sls | 3 +++ salt/minion.sls | 3 +++ salt/ssh.sls | 3 +++ salt/standalone.sls | 3 +++ salt/syndic.sls | 3 +++ 8 files changed, 24 insertions(+) diff --git a/pillar.example b/pillar.example index dc87c66..dff0336 100644 --- a/pillar.example +++ b/pillar.example @@ -14,6 +14,9 @@ salt: # install Salt via git/pip/etc.) install_packages: True + # Optional: set salt version (if install_packages is set to True) + version: 2017.7.2-1.el7 + # to overwrite map.jinja salt packages lookup: salt_master: 'salt-master' diff --git a/salt/api.sls b/salt/api.sls index 278511f..2cf9271 100644 --- a/salt/api.sls +++ b/salt/api.sls @@ -7,6 +7,9 @@ salt-api: {% if salt_settings.install_packages %} pkg.installed: - name: {{ salt_settings.salt_api }} + {%- if salt_settings.version is defined %} + - version: {{ salt_settings.version }} + {%- endif %} {% endif %} service.running: - enable: True diff --git a/salt/cloud.sls b/salt/cloud.sls index 85d2423..7d87f24 100644 --- a/salt/cloud.sls +++ b/salt/cloud.sls @@ -20,6 +20,9 @@ salt-cloud-pip-packages: salt-cloud: pkg.installed: - name: {{ salt_settings.salt_cloud }} + {%- if salt_settings.version is defined %} + - version: {{ salt_settings.version }} + {%- endif %} {%- if salt_settings.use_pip %} - require: - pip: salt-cloud-pip-packages diff --git a/salt/master.sls b/salt/master.sls index e7918e6..844e52c 100644 --- a/salt/master.sls +++ b/salt/master.sls @@ -4,6 +4,9 @@ salt-master: {% if salt_settings.install_packages %} pkg.installed: - name: {{ salt_settings.salt_master }} + {%- if salt_settings.version is defined %} + - version: {{ salt_settings.version }} + {%- endif %} {% endif %} file.recurse: - name: {{ salt_settings.config_path }}/master.d diff --git a/salt/minion.sls b/salt/minion.sls index 187dc89..eb65eec 100644 --- a/salt/minion.sls +++ b/salt/minion.sls @@ -5,6 +5,9 @@ salt-minion: {% if salt_settings.install_packages %} pkg.installed: - name: {{ salt_settings.salt_minion }} + {%- if salt_settings.version is defined %} + - version: {{ salt_settings.version }} + {%- endif %} {% endif %} file.recurse: - name: {{ salt_settings.config_path }}/minion.d diff --git a/salt/ssh.sls b/salt/ssh.sls index fad6463..8f27a77 100644 --- a/salt/ssh.sls +++ b/salt/ssh.sls @@ -4,6 +4,9 @@ ensure-salt-ssh-is-installed: pkg.installed: - name: {{ salt_settings.salt_ssh }} + {%- if salt_settings.version is defined %} + - version: {{ salt_settings.version }} + {%- endif %} {% endif %} ensure-roster-config: diff --git a/salt/standalone.sls b/salt/standalone.sls index e76e2c3..daffcec 100644 --- a/salt/standalone.sls +++ b/salt/standalone.sls @@ -4,6 +4,9 @@ salt-minion: {% if salt_settings.install_packages %} pkg.installed: - name: {{ salt_settings.salt_minion }} + {%- if salt_settings.version is defined %} + - version: {{ salt_settings.version }} + {%- endif %} {% endif %} file.recurse: - name: {{ salt_settings.config_path }}/minion.d diff --git a/salt/syndic.sls b/salt/syndic.sls index c1c3116..379da52 100644 --- a/salt/syndic.sls +++ b/salt/syndic.sls @@ -7,6 +7,9 @@ salt-syndic: {% if salt_settings.install_packages %} pkg.installed: - name: {{ salt_settings.salt_syndic }} + {%- if salt_settings.version is defined %} + - version: {{ salt_settings.version }} + {%- endif %} {% endif %} service.running: - enable: True