Skip to content

Commit

Permalink
Merge pull request #28 from idealista/features/26
Browse files Browse the repository at this point in the history
Features/26
dortegau authored May 3, 2017
2 parents 274ae7f + fac9f80 commit 99cd970
Showing 7 changed files with 79 additions and 45 deletions.
56 changes: 31 additions & 25 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,66 +2,72 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a changelog](https://github.com/olivierlacan/keep-a-changelog).

## [Unreleased](https://github.com/idealista-tech/nginx-role/tree/develop)
## [Unreleased](https://github.com/idealista/nginx-role/tree/develop)

## [1.3.1](https://github.com/idealista-tech/nginx-role/tree/1.3.1) (2017-03-27)
[Full Changelog](https://github.com/idealista-tech/nginx-role/compare/1.3.0...1.3.1)
## [1.4.0](https://github.com/idealista/nginx-role/tree/1.4.0) (2017-05-03)
[Full Changelog](https://github.com/idealista/nginx-role/compare/1.3.1...1.4.0)

### Added
- *[#26](https://github.com/idealista/nginx-role/issues/26) Extracting compile-time options to variable* @dortegau

## [1.3.1](https://github.com/idealista/nginx-role/tree/1.3.1) (2017-03-27)
[Full Changelog](https://github.com/idealista/nginx-role/compare/1.3.0...1.3.1)

### Fixed
- *[#22](https://github.com/idealista-tech/nginx-role/issues/22) Fix conflict in init scripts* @jmonterrubio
- *[#22](https://github.com/idealista/nginx-role/issues/22) Fix conflict in init scripts* @jmonterrubio

## [1.3.0](https://github.com/idealista-tech/nginx-role/tree/1.3.0) (2017-03-25)
[Full Changelog](https://github.com/idealista-tech/nginx-role/compare/1.2.2...1.3.0)
## [1.3.0](https://github.com/idealista/nginx-role/tree/1.3.0) (2017-03-25)
[Full Changelog](https://github.com/idealista/nginx-role/compare/1.2.2...1.3.0)

### Added
- *[#19](https://github.com/idealista-tech/nginx-role/issues/19) Prometheus metrics customization* @sorobon
- *[#19](https://github.com/idealista/nginx-role/issues/19) Prometheus metrics customization* @sorobon

## [1.2.2](https://github.com/idealista-tech/nginx-role/tree/1.2.2) (2017-03-17)
[Full Changelog](https://github.com/idealista-tech/nginx-role/compare/1.2.1...1.2.2)
## [1.2.2](https://github.com/idealista/nginx-role/tree/1.2.2) (2017-03-17)
[Full Changelog](https://github.com/idealista/nginx-role/compare/1.2.1...1.2.2)

### Added
- *[#16](https://github.com/idealista-tech/nginx-role/issues/16) Fix pid error* @jmonterrubio
- *[#16](https://github.com/idealista/nginx-role/issues/16) Fix pid error* @jmonterrubio

## [1.2.1](https://github.com/idealista-tech/nginx-role/tree/1.2.1) (2017-03-17)
[Full Changelog](https://github.com/idealista-tech/nginx-role/compare/1.2.0...1.2.1)
## [1.2.1](https://github.com/idealista/nginx-role/tree/1.2.1) (2017-03-17)
[Full Changelog](https://github.com/idealista/nginx-role/compare/1.2.0...1.2.1)

### Added
- *[#13](https://github.com/idealista-tech/nginx-role/issues/13) Force pid directory* @jmonterrubio
- *[#13](https://github.com/idealista/nginx-role/issues/13) Force pid directory* @jmonterrubio

## [1.2.0](https://github.com/idealista-tech/nginx-role/tree/1.2.0) (2017-02-27)
[Full Changelog](https://github.com/idealista-tech/nginx-role/compare/1.1.0...1.2.0)
## [1.2.0](https://github.com/idealista/nginx-role/tree/1.2.0) (2017-02-27)
[Full Changelog](https://github.com/idealista/nginx-role/compare/1.1.0...1.2.0)

### Added
- *[#7](https://github.com/idealista-tech/nginx-role/issues/7) Configure servers from files out of the role* @jmonterrubio
- *[#7](https://github.com/idealista/nginx-role/issues/7) Configure servers from files out of the role* @jmonterrubio

### Added
- *[#9](https://github.com/idealista-tech/nginx-role/issues/9) Add max body size configurable* @jmonterrubio
- *[#9](https://github.com/idealista/nginx-role/issues/9) Add max body size configurable* @jmonterrubio

## [1.1.0](https://github.com/idealista-tech/nginx-role/tree/1.1.0) (2017-01-24)
[Full Changelog](https://github.com/idealista-tech/nginx-role/compare/1.0.2...1.1.0)
## [1.1.0](https://github.com/idealista/nginx-role/tree/1.1.0) (2017-01-24)
[Full Changelog](https://github.com/idealista/nginx-role/compare/1.0.2...1.1.0)

### Added
- *Add prometheus metric to monitor nginx server* @jmonterrubio

## [1.0.2](https://github.com/idealista-tech/nginx-role/tree/1.0.2) (2017-01-20)
[Full Changelog](https://github.com/idealista-tech/nginx-role/compare/1.0.1...1.0.2)
## [1.0.2](https://github.com/idealista/nginx-role/tree/1.0.2) (2017-01-20)
[Full Changelog](https://github.com/idealista/nginx-role/compare/1.0.1...1.0.2)
This version could break the service if same version is installed. Please use **force_reinstall: true** parameter to avoid it.

### Added
- *Create force_reinstall parameter* @jmonterrubio
### Added
- *Improve user service management* @jmonterrubio
### Fixed
- *[#1](https://github.com/idealista-tech/nginx-role/issues/1) Fix enable/disable service* @jmonterrubio
- *[#1](https://github.com/idealista/nginx-role/issues/1) Fix enable/disable service* @jmonterrubio

##[1.0.1](https://github.com/idealista-tech/nginx-role/tree/1.0.1) (2017-01-12)
[Full Changelog](https://github.com/idealista-tech/nginx-role/compare/1.0.0...1.0.1)
##[1.0.1](https://github.com/idealista/nginx-role/tree/1.0.1) (2017-01-12)
[Full Changelog](https://github.com/idealista/nginx-role/compare/1.0.0...1.0.1)
### Added
- *Update doc* @jmonterrubio

### Changed
- *[PLATFORM-221](http://jira.sys.idealista/browse/PLATFORM-221) Remove delaycompress in logrotate* @jmonterrubio

## [1.0.0](https://github.com/idealista-tech/nginx-role/tree/1.0.0)
## [1.0.0](https://github.com/idealista/nginx-role/tree/1.0.0)
### Added
- *First release*
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ For testing purposes, [Molecule](https://molecule.readthedocs.io/) with [Vagrant
Create or add to your roles dependency file (e.g requirements.yml):

```
- src: https://github.com/idealista-tech/nginx-role.git
- src: https://github.com/idealista/nginx-role.git
scm: git
version: 1.0.0
name: nginx
@@ -71,15 +71,15 @@ molecule test

## Versioning

For the versions available, see the [tags on this repository](https://github.com/idealista-tech/nginx-role/tags).
For the versions available, see the [tags on this repository](https://github.com/idealista/nginx-role/tags).

Additionaly you can see what change in each version in the [CHANGELOG.md](CHANGELOG.md) file.

## Authors

* **Idealista** - *Work with* - [idealista-tech](https://github.com/idealista-tech)
* **Idealista** - *Work with* - [idealista](https://github.com/idealista)

See also the list of [contributors](https://github.com/idealista-tech/nginx-role/contributors) who participated in this project.
See also the list of [contributors](https://github.com/idealista/nginx-role/contributors) who participated in this project.

## License

9 changes: 9 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -51,3 +51,12 @@ metrics_templates_path: "{{ playbook_dir }}/templates/metrics"
## Miscellaneous
# Set true to force the download and installation of the package
nginx_force_reinstall: false

## Nginx compile time options
## https://www.nginx.com/resources/wiki/start/topics/tutorials/installoptions/
nginx_compile_time_options_builtin_modules:
- http_stub_status_module

nginx_compile_time_options_external_modules_paths:
- /tmp/headers-more-nginx-module-{{ headers_more_version }}
- /tmp/lua-nginx-module-{{ lua_module_version }}
6 changes: 3 additions & 3 deletions molecule.yml
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@ vagrant:
# molecule's --platform option will look for these names
raw_config_args:
- "landrush.enabled = true"
- "landrush.tld = ''"
- "landrush.tld = 'vm'"
- "landrush.guest_redirect_dns = false"
platforms:
- name: Debian
@@ -44,14 +44,14 @@ vagrant:
cpus: 1

instances:
- name: nginx
- name: nginx.vm
ansible_groups:
- group01
interfaces:
- network_name: private_network
type: dhcp
auto_config: true
- name: nginx-old
- name: nginx-old.vm
ansible_groups:
- group01
interfaces:
31 changes: 19 additions & 12 deletions tasks/install.yml
Original file line number Diff line number Diff line change
@@ -55,21 +55,28 @@
dest: /tmp
when: 'nginx_force_reinstall or nginx_check|failed or "nginx/{{ nginx_version }}" not in nginx_check.stderr'

- name: NGINX | Define compile-time options
set_fact:
nginx_compile_time_options_str: "{{ nginx_compile_time_options_str | default('') }} {{ '--' + item.option + '=' + item.value }}"
with_items:
- "{{ nginx_compile_time_options }}"

- name: NGINX | Define builtin modules options
set_fact:
nginx_compile_time_options_builtin_modules_str: "{{ nginx_compile_time_options_builtin_modules_str | default('') }} {{ '--with-' + item }}"
with_items:
- "{{ nginx_compile_time_options_builtin_modules }}"

- name: NGINX | Define External modules options
set_fact:
nginx_compile_time_options_external_modules_paths_str: "{{ nginx_compile_time_options_external_modules_paths_str | default('') }} {{ '--add-module=' + item }}"
with_items:
- "{{ nginx_compile_time_options_external_modules_paths }}"

- name: NGINX | Install nginx
command: "chdir=/tmp/nginx-{{ nginx_version }} {{item}}"
with_items:
- ./configure
--prefix={{ nginx_install_bin_path }}
--user={{ nginx_user }}
--group={{ nginx_group }}
--with-http_stub_status_module
--add-module=/tmp/headers-more-nginx-module-{{ headers_more_version }}
--add-module=/tmp/lua-nginx-module-{{ lua_module_version }}
--conf-path={{ nginx_conf }}
--error-log-path={{ nginx_error_log }}
--http-log-path={{ nginx_access_log }}
--pid-path=/run/nginx/nginx.pid
--lock-path=/var/lock/nginx.lock
- "./configure {{ nginx_compile_time_options_str }} {{ nginx_compile_time_options_builtin_modules_str }} {{ nginx_compile_time_options_external_modules_paths_str }}"
- make
- make install
when: 'nginx_force_reinstall or nginx_check|failed or "nginx/{{ nginx_version }}" not in nginx_check.stderr'
2 changes: 1 addition & 1 deletion tests/playbook.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- hosts: nginx-old
- hosts: nginx-old.vm
pre_tasks:
- name: NGINX | Check nginx version
command: nginx -v
12 changes: 12 additions & 0 deletions vars/main.yml
Original file line number Diff line number Diff line change
@@ -12,3 +12,15 @@ lua_dependencies:
- libreadline-dev
- lib32ncurses5-dev
lua_url: http://www.lua.org/ftp/lua-{{ lua_version }}.tar.gz

## Nginx compile time options
## https://www.nginx.com/resources/wiki/start/topics/tutorials/installoptions/
nginx_compile_time_options:
- { option: "prefix", value: "{{ nginx_install_bin_path }}" }
- { option: "user", value: "{{ nginx_user }}" }
- { option: "group", value: "{{ nginx_group }}" }
- { option: "conf-path", value: "{{ nginx_conf }}" }
- { option: "error-log-path", value: "{{ nginx_error_log }}" }
- { option: "http-log-path", value: "{{ nginx_access_log }}" }
- { option: "pid-path", value: /run/nginx/nginx.pid }
- { option: "lock-path", value: /var/lock/nginx.lock }

0 comments on commit 99cd970

Please sign in to comment.