From a343a146bd2a1455c7dfe56d8014ce0259502650 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armando=20L=C3=BCscher?= Date: Mon, 17 Jul 2017 16:15:10 +0200 Subject: [PATCH] Allow overriding of nginx_vhost_path and nginx_default_vhost_path. --- tasks/main.yml | 10 ++++++++++ vars/Archlinux.yml | 4 ++-- vars/Debian.yml | 4 ++-- vars/FreeBSD.yml | 4 ++-- vars/OpenBSD.yml | 4 ++-- vars/RedHat.yml | 4 ++-- 6 files changed, 20 insertions(+), 10 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 4ee901a..3904b04 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -3,6 +3,16 @@ - name: Include OS-specific variables. include_vars: "{{ ansible_os_family }}.yml" +- name: Define nginx_vhost_path. + set_fact: + nginx_vhost_path: "{{ __nginx_vhost_path }}" + when: nginx_vhost_path is not defined + +- name: Define nginx_default_vhost_path. + set_fact: + nginx_default_vhost_path: "{{ __nginx_default_vhost_path }}" + when: nginx_default_vhost_path is not defined + - name: Define nginx_user. set_fact: nginx_user: "{{ __nginx_user }}" diff --git a/vars/Archlinux.yml b/vars/Archlinux.yml index 593e100..7c24a0f 100644 --- a/vars/Archlinux.yml +++ b/vars/Archlinux.yml @@ -4,6 +4,6 @@ nginx_conf_path: /etc/nginx/conf.d nginx_conf_file_path: /etc/nginx/nginx.conf nginx_mime_file_path: /etc/nginx/mime.types nginx_pidfile: /run/nginx.pid -nginx_vhost_path: /etc/nginx/sites-enabled -nginx_default_vhost_path: /etc/nginx/sites-enabled/default +__nginx_vhost_path: /etc/nginx/sites-enabled +__nginx_default_vhost_path: /etc/nginx/sites-enabled/default __nginx_user: "http" diff --git a/vars/Debian.yml b/vars/Debian.yml index cb12770..c83ca61 100644 --- a/vars/Debian.yml +++ b/vars/Debian.yml @@ -4,6 +4,6 @@ nginx_conf_path: /etc/nginx/conf.d nginx_conf_file_path: /etc/nginx/nginx.conf nginx_mime_file_path: /etc/nginx/mime.types nginx_pidfile: /run/nginx.pid -nginx_vhost_path: /etc/nginx/sites-enabled -nginx_default_vhost_path: /etc/nginx/sites-enabled/default +__nginx_vhost_path: /etc/nginx/sites-enabled +__nginx_default_vhost_path: /etc/nginx/sites-enabled/default __nginx_user: "www-data" diff --git a/vars/FreeBSD.yml b/vars/FreeBSD.yml index b032f98..4f019ac 100644 --- a/vars/FreeBSD.yml +++ b/vars/FreeBSD.yml @@ -4,6 +4,6 @@ nginx_conf_path: /usr/local/etc/nginx/conf.d nginx_conf_file_path: /usr/local/etc/nginx/nginx.conf nginx_mime_file_path: /usr/local/etc/nginx/mime.types nginx_pidfile: /var/run/nginx.pid -nginx_vhost_path: /usr/local/etc/nginx/sites-enabled -nginx_default_vhost_path: /usr/local/etc/nginx/sites-enabled/default +__nginx_vhost_path: /usr/local/etc/nginx/sites-enabled +__nginx_default_vhost_path: /usr/local/etc/nginx/sites-enabled/default __nginx_user: "www" diff --git a/vars/OpenBSD.yml b/vars/OpenBSD.yml index a5a5c9d..94af62c 100644 --- a/vars/OpenBSD.yml +++ b/vars/OpenBSD.yml @@ -4,7 +4,7 @@ nginx_conf_path: /etc/nginx/conf.d nginx_conf_file_path: /etc/nginx/nginx.conf nginx_mime_file_path: /etc/nginx/mime.types nginx_pidfile: /var/run/nginx.pid -nginx_vhost_path: /etc/nginx/sites-enabled -nginx_default_vhost_path: /etc/nginx/sites-enabled/default +__nginx_vhost_path: /etc/nginx/sites-enabled +__nginx_default_vhost_path: /etc/nginx/sites-enabled/default nginx_package_name: "nginx--" __nginx_user: "www" diff --git a/vars/RedHat.yml b/vars/RedHat.yml index 0138f8d..d58a295 100644 --- a/vars/RedHat.yml +++ b/vars/RedHat.yml @@ -4,6 +4,6 @@ nginx_conf_path: /etc/nginx/conf.d nginx_conf_file_path: /etc/nginx/nginx.conf nginx_mime_file_path: /etc/nginx/mime.types nginx_pidfile: /var/run/nginx.pid -nginx_vhost_path: /etc/nginx/conf.d -nginx_default_vhost_path: /etc/nginx/conf.d/default.conf +__nginx_vhost_path: /etc/nginx/conf.d +__nginx_default_vhost_path: /etc/nginx/conf.d/default.conf __nginx_user: "nginx"