Skip to content

Commit

Permalink
Fix nginx to work with RedHat/CentOS
Browse files Browse the repository at this point in the history
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
  • Loading branch information
andymcc committed Sep 1, 2016
1 parent 6b3af85 commit 15733bb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tasks/keystone_nginx.yml
Expand Up @@ -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

Expand All @@ -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
2 changes: 2 additions & 0 deletions vars/redhat-7.yml
Expand Up @@ -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
2 changes: 2 additions & 0 deletions vars/ubuntu-14.04.yml
Expand Up @@ -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
2 changes: 2 additions & 0 deletions vars/ubuntu-16.04.yml
Expand Up @@ -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

0 comments on commit 15733bb

Please sign in to comment.