Fix nginx to work with RedHat/CentOS

The CentOS version of nginx uses a conf.d style directory for virtual
hosts instead of a sites-available/sites-enabled approach.

We can add a var to select where the configuration file is placed, and
only perform the link on Debian based systems.

Change-Id: I00b8af093e17a4450b642a1534b8ec647c9d2513
This commit is contained in:
Andy McCrae 2016-09-01 10:28:02 +01:00
parent 6b3af85bf2
commit 15733bbd2f
4 changed files with 8 additions and 1 deletions

View File

@ -37,7 +37,7 @@
- name: Configure virtual hosts
template:
src: keystone_nginx.conf.j2
dest: "/etc/nginx/sites-available/{{ item }}.conf"
dest: "/etc/nginx/{{ keystone_nginx_conf_path }}/{{ item }}.conf"
with_items: keystone_wsgi_program_names
notify: Restart Nginx
@ -47,4 +47,5 @@
path: "/etc/nginx/sites-enabled/{{ item }}.conf"
state: link
with_items: keystone_wsgi_program_names
when: ansible_os_family == "Debian"
notify: Restart Nginx

View File

@ -72,4 +72,6 @@ keystone_apache_configs:
- { src: "keystone-httpd.conf.j2", dest: "/etc/httpd/conf.d/keystone-httpd.conf" }
- { src: "keystone-httpd-mpm.conf.j2", dest: "/etc/httpd/conf.modules.d/mpm_{{ keystone_httpd_mpm_backend }}.conf" }
keystone_nginx_conf_path: "conf.d"
keystone_system_service_name: httpd

View File

@ -65,4 +65,6 @@ keystone_apache_configs:
- { src: "keystone-httpd.conf.j2", dest: "/etc/apache2/sites-available/keystone-httpd.conf" }
- { src: "keystone-httpd-mpm.conf.j2", dest: "/etc/apache2/mods-available/mpm_{{ keystone_httpd_mpm_backend }}.conf" }
keystone_nginx_conf_path: "sites-available"
keystone_system_service_name: apache2

View File

@ -65,4 +65,6 @@ keystone_apache_configs:
- { src: "keystone-httpd.conf.j2", dest: "/etc/apache2/sites-available/keystone-httpd.conf" }
- { src: "keystone-httpd-mpm.conf.j2", dest: "/etc/apache2/mods-available/mpm_{{ keystone_httpd_mpm_backend }}.conf" }
keystone_nginx_conf_path: "sites-available"
keystone_system_service_name: apache2