|
|
|
|
|
|
|
|
|
|
|
|
|
|
{% from 'nginx/ng/map.jinja' import nginx, sls_block with context %} |
|
|
{% from 'nginx/ng/map.jinja' import nginx, sls_block with context %} |
|
|
|
|
|
|
|
|
nginx_build_dep: |
|
|
|
|
|
{% if salt['grains.get']('os_family') == 'Debian' %} |
|
|
|
|
|
cmd.run: |
|
|
|
|
|
- name: apt-get -y build-dep nginx |
|
|
|
|
|
{% elif salt['grains.get']('os_family') == 'RedHat' %} |
|
|
|
|
|
cmd.run: |
|
|
|
|
|
- name: yum-builddep -y nginx |
|
|
|
|
|
{% else %} |
|
|
|
|
|
## install build deps for other distros |
|
|
|
|
|
{% endif %} |
|
|
|
|
|
|
|
|
nginx_deps: |
|
|
|
|
|
pkg.installed: |
|
|
|
|
|
- pkgs: |
|
|
|
|
|
- libpcre3-dev |
|
|
|
|
|
- libssl-dev |
|
|
|
|
|
- zlib1g-dev |
|
|
|
|
|
|
|
|
nginx_download: |
|
|
nginx_download: |
|
|
archive.extracted: |
|
|
archive.extracted: |
|
|
|
|
|
|
|
|
- archive_format: tar |
|
|
- archive_format: tar |
|
|
- if_missing: /usr/sbin/nginx-{{ nginx.source_version }} |
|
|
- if_missing: /usr/sbin/nginx-{{ nginx.source_version }} |
|
|
- require: |
|
|
- require: |
|
|
- cmd: nginx_build_dep |
|
|
|
|
|
- onchanges: |
|
|
|
|
|
- cmd: nginx_build_dep |
|
|
|
|
|
|
|
|
- pkg: nginx_deps |
|
|
|
|
|
|
|
|
nginx_configure: |
|
|
nginx_configure: |
|
|
cmd.run: |
|
|
cmd.run: |
|
|
- name: ./configure --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path={{ nginx.lookup.conf_file or '/etc/nginx/nginx.conf' }} {{ nginx.source.opts | join(' ') }} |
|
|
- name: ./configure --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path={{ nginx.lookup.conf_file or '/etc/nginx/nginx.conf' }} {{ nginx.source.opts | join(' ') }} |
|
|
- cwd: /tmp/nginx-{{ nginx.source_version }} |
|
|
- cwd: /tmp/nginx-{{ nginx.source_version }} |
|
|
- require: |
|
|
|
|
|
- archive: nginx_download |
|
|
|
|
|
- onchanges: |
|
|
- onchanges: |
|
|
- archive: nginx_download |
|
|
- archive: nginx_download |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cmd.run: |
|
|
cmd.run: |
|
|
- name: make |
|
|
- name: make |
|
|
- cwd: /tmp/nginx-{{ nginx.source_version }} |
|
|
- cwd: /tmp/nginx-{{ nginx.source_version }} |
|
|
- require: |
|
|
|
|
|
- cmd: nginx_configure |
|
|
|
|
|
- onchanges: |
|
|
- onchanges: |
|
|
- cmd: nginx_configure |
|
|
- cmd: nginx_configure |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cmd.run: |
|
|
cmd.run: |
|
|
- name: make install |
|
|
- name: make install |
|
|
- cwd: /tmp/nginx-{{ nginx.source_version }} |
|
|
- cwd: /tmp/nginx-{{ nginx.source_version }} |
|
|
- require: |
|
|
|
|
|
- cmd: nginx_compile |
|
|
|
|
|
- onchanges: |
|
|
- onchanges: |
|
|
- cmd: nginx_compile |
|
|
- cmd: nginx_compile |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
file.copy: |
|
|
file.copy: |
|
|
- name: /usr/sbin/nginx-{{ nginx.source_version }} |
|
|
- name: /usr/sbin/nginx-{{ nginx.source_version }} |
|
|
- source: /usr/sbin/nginx |
|
|
- source: /usr/sbin/nginx |
|
|
- require: |
|
|
|
|
|
- cmd: nginx_install |
|
|
|
|
|
- onchanges: |
|
|
- onchanges: |
|
|
- cmd: nginx_install |
|
|
- cmd: nginx_install |