From 1c1d338359142e6eadf02a03ca58a9220c75bbb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Paw=C5=82owski?= Date: Wed, 19 Aug 2015 16:59:04 +0200 Subject: [PATCH 1/2] ng.install: subscribe to repo only if install_from_repo variable is set to true --- nginx/ng/install.sls | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nginx/ng/install.sls b/nginx/ng/install.sls index 99a84dd..01c164d 100644 --- a/nginx/ng/install.sls +++ b/nginx/ng/install.sls @@ -51,7 +51,12 @@ nginx_zypp_repo: {% if salt['grains.get']('os_family') == 'RedHat' %} nginx_yum_repo: - pkgrepo.managed: + pkgrepo: + {%- if nginx.install_from_repo %} + - managed + {%- else %} + - absent + {%- endif %} - name: nginx - humanname: nginx repo {%- if salt['grains.get']('os') == 'CentOS' %} From dc5600d19e0f4f88f417c245048e461be0349a2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Paw=C5=82owski?= Date: Thu, 20 Aug 2015 09:17:55 +0200 Subject: [PATCH 2/2] ng.install: follow style recommendation --- nginx/ng/install.sls | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/nginx/ng/install.sls b/nginx/ng/install.sls index 01c164d..c2d1ae3 100644 --- a/nginx/ng/install.sls +++ b/nginx/ng/install.sls @@ -51,12 +51,11 @@ nginx_zypp_repo: {% if salt['grains.get']('os_family') == 'RedHat' %} nginx_yum_repo: - pkgrepo: - {%- if nginx.install_from_repo %} - - managed - {%- else %} - - absent - {%- endif %} + {%- if nginx.install_from_repo %} + pkgrepo.managed: + {%- else %} + pkgrepo.absent: + {%- endif %} - name: nginx - humanname: nginx repo {%- if salt['grains.get']('os') == 'CentOS' %}