New feature: install nginx from backports

pull/14/head
Emilien Mantel 2016-01-11 15:16:24 +01:00
parent d463b690ec
commit f64e1f1106
4 changed files with 14 additions and 5 deletions

View File

@ -10,12 +10,13 @@ SSL management will come later.
Requirements
------------
None.
None. If you set true to `nginx_backports`, you must install backports repository before lauching this role.
Role Variables
--------------
- `nginx_apt_package`: APT nginx package (try: apt-cache search ^nginx)
- `nginx_backports`: Install nginx from backport repository (bool)
- `nginx_root`: root directory where you want to have your files
- `nginx_log_dir`: log directory (if you change it, don't forget to change logrotate config)
- `nginx_ssl_dir`: directory where you install your SSL/TLS keys

View File

@ -1,6 +1,7 @@
---
nginx_apt_package: nginx-full
nginx_backports: false
#
# Nginx shared variables

View File

@ -1,10 +1,15 @@
---
- name: APT | Install nginx and dependencies
apt: pkg={{ item }} state=latest update_cache=yes cache_valid_time=3600
with_items:
- "{{ nginx_apt_package }}"
- python-passlib
apt: >
pkg={{ nginx_apt_package }}
state=present
update_cache=yes
cache_valid_time=3600
default_release={{ ansible_distribution_release + '-backports' if nginx_backports else ansible_distribution_release }}
- name: APT | Install python-passlib
apt: pkg=python-passlib state=present
- name: SHELL | Get Nginx version
shell: nginx -v 2>&1 | sed -r 's#.*/##;' | cut -d ' ' -f 1

View File

@ -2,6 +2,7 @@
- hosts: all
pre_tasks:
- apt_repository: repo='deb http://httpredir.debian.org/debian {{ ansible_distribution_release }}-backports main' state=present
- apt: pkg={{ item }} update_cache=yes cache_valid_time=3600 state=present
with_items:
- php5-fpm
@ -10,6 +11,7 @@
- service: name=fcgiwrap state=started
- pause: seconds=5
vars:
nginx_backports: true
nginx_php: true
nginx_upstreams:
- name: 'test'