ansible-role-redmine/tasks/nginx.yml

33 lines
1.1 KiB
YAML

---
- block:
- name: Install a nginx configuration of the unicorn backend
template:
src: nginx_unicorn.conf.j2
dest: /etc/nginx/conf.d/nginx_unicorn.conf
notify: Restart nginx
tags: [ 'ruby', 'redmine', 'unicorn', 'unicorn_nginx' ]
when: ansible_distribution_version is version_compare('18.04', '==')
- name: Install and enable the nginx virtualhost files on Deb based systems
block:
- name: Install the nginx virtualhost files
template:
src: nginx-redmine-virthost.j2
dest: '/etc/nginx/sites-available/{{ item.virthost_name }}'
owner: root
group: root
mode: 0444
with_items: '{{ nginx_virthosts | default(omit) }}'
notify: Reload nginx
- name: Enable the nginx virtualhosts
file:
src: '/etc/nginx/sites-available/{{ item.virthost_name }}'
dest: '/etc/nginx/sites-enabled/{{ item.virthost_name }}'
state: link
with_items: '{{ nginx_virthosts | default(omit) }}'
notify: Reload nginx
tags: [ 'ruby', 'redmine', 'unicorn', 'unicorn_nginx', 'virtualhost', 'nginx' ]