forked from gergely/calendar-social
Add Vagrant related files
This commit is contained in:
42
ansible/roles/nginx/tasks/main.yml
Normal file
42
ansible/roles/nginx/tasks/main.yml
Normal file
@@ -0,0 +1,42 @@
|
||||
---
|
||||
|
||||
- name: Install Nginx
|
||||
dnf:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
with_items:
|
||||
- nginx
|
||||
|
||||
- name: Create the Nginx configuration file for SSL
|
||||
template:
|
||||
src: site-ssl.conf.j2
|
||||
dest: /etc/nginx/conf.d/{{ project_name }}-ssl.conf
|
||||
when: use_ssl
|
||||
notify: Reload Nginx
|
||||
|
||||
- name: Create the Nginx configuration file (non-SSL)
|
||||
template:
|
||||
src: site.conf.j2
|
||||
dest: /etc/nginx/conf.d/{{ project_name }}.conf
|
||||
when: not use_ssl
|
||||
notify: Reload Nginx
|
||||
|
||||
- name: Ensure that the default site is removed
|
||||
file:
|
||||
path: /etc/nginx/conf.d/default.conf
|
||||
state: absent
|
||||
|
||||
- name: Ensure Nginx service is started, enable service on restart
|
||||
service:
|
||||
name: nginx
|
||||
state: restarted
|
||||
enabled: yes
|
||||
when: enabled
|
||||
|
||||
- name: Stop nginx for local dev, disable service
|
||||
service:
|
||||
name: nginx
|
||||
state: stopped
|
||||
enabled: no
|
||||
notify: Stop Nginx
|
||||
when: not enabled
|
Reference in New Issue
Block a user