2019-05-10 23:07:18 +02:00
|
|
|
# nginx.src
|
2016-05-10 13:00:18 +02:00
|
|
|
#
|
|
|
|
# Manages installation of nginx from source.
|
|
|
|
|
2019-05-10 23:07:18 +02:00
|
|
|
{% from 'nginx/map.jinja' import nginx, sls_block with context %}
|
2016-05-10 13:00:18 +02:00
|
|
|
|
2016-08-10 23:23:16 +02:00
|
|
|
nginx_deps:
|
|
|
|
pkg.installed:
|
|
|
|
- pkgs:
|
|
|
|
- libpcre3-dev
|
|
|
|
- libssl-dev
|
|
|
|
- zlib1g-dev
|
2016-05-10 13:00:18 +02:00
|
|
|
|
|
|
|
nginx_download:
|
|
|
|
archive.extracted:
|
|
|
|
- name: /tmp/
|
|
|
|
- source: http://nginx.org/download/nginx-{{ nginx.source_version }}.tar.gz
|
|
|
|
- source_hash: sha256={{ nginx.source_hash }}
|
|
|
|
- archive_format: tar
|
|
|
|
- if_missing: /usr/sbin/nginx-{{ nginx.source_version }}
|
|
|
|
- require:
|
2016-08-10 23:23:16 +02:00
|
|
|
- pkg: nginx_deps
|
2016-05-10 13:00:18 +02:00
|
|
|
|
|
|
|
nginx_configure:
|
|
|
|
cmd.run:
|
2019-05-10 23:07:18 +02:00
|
|
|
- name: ./configure --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path={{ nginx.lookup.conf_file }} {{ nginx.source.opts | join(' ') }}
|
2016-05-10 13:00:18 +02:00
|
|
|
- cwd: /tmp/nginx-{{ nginx.source_version }}
|
|
|
|
- onchanges:
|
|
|
|
- archive: nginx_download
|
|
|
|
|
|
|
|
nginx_compile:
|
|
|
|
cmd.run:
|
|
|
|
- name: make
|
|
|
|
- cwd: /tmp/nginx-{{ nginx.source_version }}
|
2016-06-22 12:09:05 +02:00
|
|
|
- onchanges:
|
|
|
|
- cmd: nginx_configure
|
2016-05-10 13:00:18 +02:00
|
|
|
|
|
|
|
nginx_install:
|
|
|
|
cmd.run:
|
|
|
|
- name: make install
|
|
|
|
- cwd: /tmp/nginx-{{ nginx.source_version }}
|
|
|
|
- onchanges:
|
|
|
|
- cmd: nginx_compile
|
|
|
|
|
|
|
|
nginx_link:
|
|
|
|
file.copy:
|
|
|
|
- name: /usr/sbin/nginx-{{ nginx.source_version }}
|
|
|
|
- source: /usr/sbin/nginx
|
|
|
|
- onchanges:
|
2016-05-25 13:04:27 +02:00
|
|
|
- cmd: nginx_install
|