From 997ef47905fe26ada1d2d46fa91280f4e4f575f8 Mon Sep 17 00:00:00 2001 From: Roshan Bangera Date: Wed, 13 May 2015 19:00:12 -0500 Subject: [PATCH] * added pillar variable to specify os release version for nginx package repo base url for RedHat family os hosts --- nginx/ng/install.sls | 4 ++-- nginx/ng/map.jinja | 1 + pillar.example | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/nginx/ng/install.sls b/nginx/ng/install.sls index 8de42dd..43a0839 100644 --- a/nginx/ng/install.sls +++ b/nginx/ng/install.sls @@ -55,9 +55,9 @@ nginx_yum_repo: - name: nginx - humanname: nginx repo {%- if salt['grains.get']('os') == 'CentOS' %} - - baseurl: 'http://nginx.org/packages/centos/$releasever/$basearch/' + - baseurl: 'http://nginx.org/packages/centos/{{ nginx.lookup.rh_os_releasever }}/$basearch/' {%- else %} - - baseurl: 'http://nginx.org/packages/rhel/$releasever/$basearch/' + - baseurl: 'http://nginx.org/packages/rhel/{{ nginx.lookup.rh_os_releasever }}/$basearch/' {%- endif %} - gpgcheck: False - enabled: True diff --git a/nginx/ng/map.jinja b/nginx/ng/map.jinja index 4d67e1f..ea0ddc5 100644 --- a/nginx/ng/map.jinja +++ b/nginx/ng/map.jinja @@ -25,6 +25,7 @@ 'vhost_enabled': '/etc/nginx/conf.d', 'vhost_use_symlink': False, 'pid_file': '/var/run/nginx.pid', + 'rh_os_releasever': '$releasever', }, 'Suse': { 'package': 'nginx', diff --git a/pillar.example b/pillar.example index 109225b..60b8a51 100644 --- a/pillar.example +++ b/pillar.example @@ -35,6 +35,7 @@ nginx: vhost_available: /etc/nginx/sites-available vhost_enabled: /etc/nginx/sites-enabled vhost_use_symlink: True + rh_os_releasever: '6' # Source compilation is not currently a part of nginx.ng from_source: False