ansible/roles/nginx-rails/tasks/main.yml in subspace-2.4.1 vs ansible/roles/nginx-rails/tasks/main.yml in subspace-2.4.2
- old
+ new
@@ -3,17 +3,25 @@
template:
src: nginx-project
dest: /etc/nginx/sites-available/{{project_name}}
become: true
-- name: Enable the app
+- name: Enable the non-ssl app
file:
src: /etc/nginx/sites-available/{{project_name}}
dest: /etc/nginx/sites-enabled/{{project_name}}
- state: "{{ (ssl_enabled and nginx_ssl_config is defined) | ternary('absent', 'link') }}"
+ state: link
+ when: ssl_enabled != true or nginx_ssl_config is not defined
become: true
+- name: Disable the non-ssl app
+ file:
+ dest: /etc/nginx/sites-enabled/{{project_name}}
+ state: absent
+ when: (ssl_enabled and nginx_ssl_config is defined)
+ become: true
+
- name: create ssl nginx config for rails app
template:
src: nginx-project-ssl
dest: /etc/nginx/sites-available/{{project_name}}-ssl
when: (ssl_enabled and nginx_ssl_config is defined)
@@ -21,10 +29,18 @@
- name: Enable SSL configured app
file:
src: /etc/nginx/sites-available/{{project_name}}-ssl
dest: /etc/nginx/sites-enabled/{{project_name}}-ssl
- state: "{{ (ssl_enabled and nginx_ssl_config is defined) | ternary('link', 'absent') }}"
+ state: link
+ when: (ssl_enabled and nginx_ssl_config is defined)
+ become: true
+
+- name: Disable SSL configured app
+ file:
+ dest: /etc/nginx/sites-enabled/{{project_name}}-ssl
+ state: absent
+ when: ssl_enabled != true or nginx_ssl_config is not defined
become: true
- name: Enable a default server if one is not defined in the app
template:
src: 'default_server'