diff --git a/nginx/ng/install.sls b/nginx/ng/install.sls index 8de42dd..99a84dd 100644 --- a/nginx/ng/install.sls +++ b/nginx/ng/install.sls @@ -57,7 +57,7 @@ nginx_yum_repo: {%- if salt['grains.get']('os') == 'CentOS' %} - baseurl: 'http://nginx.org/packages/centos/$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..beb765d 100644 --- a/pillar.example +++ b/pillar.example @@ -35,6 +35,8 @@ nginx: vhost_available: /etc/nginx/sites-available vhost_enabled: /etc/nginx/sites-enabled vhost_use_symlink: True + # This is required for RedHat like distros (Amazon Linux) that don't follow semantic versioning for $releasever + rh_os_releasever: '6' # Source compilation is not currently a part of nginx.ng from_source: False