2016-06-13 16:24:30 +02:00
|
|
|
---
|
|
|
|
# Install the nginx virtualhosts
|
2017-09-12 15:32:53 +02:00
|
|
|
- name: Install the nginx virtualhost, if a specific one has been defined
|
2016-06-13 16:24:30 +02:00
|
|
|
template: src={{ item.servername }}-virtualhost.j2 dest=/etc/nginx/sites-available/{{ item.servername }} owner=root group=root mode=0444
|
|
|
|
with_items: '{{ tomcat_m_instances }}'
|
|
|
|
when: not smartgears_install_generic_virthost
|
|
|
|
notify: Reload nginx
|
|
|
|
tags: [ 'nginx', 'virtualhost' ]
|
|
|
|
|
2017-09-12 15:32:53 +02:00
|
|
|
- name: Install the nginx generic virtualhost
|
2016-06-13 16:24:30 +02:00
|
|
|
template: src=generic-smartgears-virtualhost.j2 dest=/etc/nginx/sites-available/{{ item.servername }} owner=root group=root mode=0444
|
|
|
|
with_items: '{{ tomcat_m_instances }}'
|
|
|
|
when: smartgears_install_generic_virthost
|
|
|
|
notify: Reload nginx
|
|
|
|
tags: [ 'nginx', 'virtualhost' ]
|
|
|
|
|
|
|
|
- name: Enable the nginx virtualhosts
|
2017-09-12 15:32:53 +02:00
|
|
|
file: src=/etc/nginx/sites-available/{{ item.servername }} dest=/etc/nginx/sites-enabled/smartgears_{{ item.smartgears_id }}.conf state=link
|
|
|
|
with_items: '{{ tomcat_m_instances }}'
|
|
|
|
notify: Reload nginx
|
|
|
|
tags: [ 'nginx', 'virtualhost' ]
|
|
|
|
|
|
|
|
- name: Remove the old hostname based virtualhost filename
|
|
|
|
file: dest=/etc/nginx/sites-enabled/{{ item.servername }}.conf state=absent
|
|
|
|
with_items: '{{ tomcat_m_instances }}'
|
|
|
|
notify: Reload nginx
|
|
|
|
tags: [ 'nginx', 'virtualhost' ]
|
|
|
|
|
|
|
|
- name: Remove the old ubuntu.conf virtualhost filename
|
|
|
|
file: dest=/etc/nginx/sites-enabled/ubuntu.conf state=absent
|
2016-06-13 16:24:30 +02:00
|
|
|
with_items: '{{ tomcat_m_instances }}'
|
|
|
|
notify: Reload nginx
|
|
|
|
tags: [ 'nginx', 'virtualhost' ]
|
|
|
|
|