roles/nginx: Official builds for Debian Stretch

Now that there are official nginx.org builds for Debian 9 we don't
need to use Debian's own nginx packages.
This commit is contained in:
Alan Orth 2017-04-14 16:06:06 +03:00
parent a6034fda0c
commit a7a6fa38c9
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9
3 changed files with 3 additions and 30 deletions

View File

@ -26,8 +26,8 @@ letsencrypt_root: /etc/letsencrypt/live
# Location of Let's Encrypt's certbot script
letsencrypt_certbot_dest: /opt/certbot-auto
# stable is 1.10.x
# mainline is 1.11.x
# stable is 1.12.x
# mainline is 1.13.x
nginx_version: mainline
# vim: set ts=2 sw=2:

View File

@ -1,18 +1,9 @@
---
# There is no nginx.org build for Debian 9 (stretch) yet, so we will use the
# builds in Debian's own repositories for now. This creates a few problems
# in this playbook, and we need to remember to undo these workarounds when
# the Debian stretch builds become available.
#
# See: https://nginx.org/packages/mainline/debian/dists/
- name: Add nginx.org apt signing key
when: ansible_distribution_major_version | version_compare('9', '!=')
apt_key: id=0x573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62 url=https://nginx.org/keys/nginx_signing.key state=present
tags: nginx, packages
- name: Add nginx.org repo
when: ansible_distribution_major_version | version_compare('9', '!=')
template: src=nginx_org_sources.list.j2 dest=/etc/apt/sources.list.d/nginx_org_sources.list owner=root group=root mode=0644
tags: nginx, packages
@ -40,15 +31,9 @@
tags: nginx
- name: Create fastcgi cache dir
when: ansible_distribution_major_version | version_compare('9', '!=')
file: path=/var/cache/nginx/cached/fastcgi state=directory owner=nginx group=nginx mode=0755
tags: nginx
- name: Create fastcgi cache dir
when: ansible_distribution_major_version | version_compare('9', '==')
file: path=/var/cache/nginx/cached/fastcgi state=directory owner=www-data group=www-data mode=0755
tags: nginx
- include: vhosts.yml
when: nginx_vhosts is defined
tags: nginx

View File

@ -17,15 +17,9 @@
- reload nginx
- name: Create vhost document roots
when: ansible_distribution_major_version | version_compare('9', '!=')
file: path={{ nginx_root_prefix }}/{{ item.domain_name }} state=directory mode=0755 owner=nginx group=nginx
with_items: "{{ nginx_vhosts }}"
- name: Create vhost document roots
when: ansible_distribution_major_version | version_compare('9', '==')
file: path={{ nginx_root_prefix }}/{{ item.domain_name }} state=directory mode=0755 owner=www-data group=www-data
with_items: "{{ nginx_vhosts }}"
- name: Install WordPress
git: repo=https://github.com/WordPress/WordPress.git dest={{ nginx_root_prefix }}/{{ item.domain_name }}/wordpress version={{ item.wordpress_version }} depth=1 force=yes
when: item.has_wordpress is defined and item.has_wordpress == True
@ -34,13 +28,7 @@
- name: Fix WordPress directory permissions
file: path={{ nginx_root_prefix }}/{{ item.domain_name }} state=directory owner=nginx group=nginx recurse=yes
when: item.has_wordpress is defined and item.has_wordpress == True and ansible_distribution_major_version | version_compare('9', '!=')
with_items: "{{ nginx_vhosts }}"
tags: wordpress
- name: Fix WordPress directory permissions
file: path={{ nginx_root_prefix }}/{{ item.domain_name }} state=directory owner=www-data group=www-data recurse=yes
when: item.has_wordpress is defined and item.has_wordpress == True and ansible_distribution_major_version | version_compare('9', '==')
when: item.has_wordpress is defined and item.has_wordpress == True
with_items: "{{ nginx_vhosts }}"
tags: wordpress