Skip to content

Commit 2a32c35

Browse files
committed
Fix #15: add setting to only configure Apache for SSL
1 parent 1102032 commit 2a32c35

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ Optional Configuration variables
4444
- `conf.compile_msgs`: Set to `true` in order to compile i18n messages.
4545
- `conf.memcached`: Set to `true` in order to clear cache.
4646
- `conf.data`: A list of the dump files to load data from, eg `[project, auth]`, omit to skip loaddata. Depends on `loaddata` variable to be `true`.
47+
- `conf.https_only`: If true then configure Apache
48+
[only for SSL](https://github.com/Wtower/ansible-node-deploy/issues/6). Default: `false`.
4749

4850
Other default variables
4951
-----------------------

examples/django_sites.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ django_sites:
1010
host_user: username
1111
python_version: 3.4
1212
memcached: true
13+
https_only: true
1314
data:
1415
- auth
1516
- app2

tasks/main.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,14 @@
125125
- name: Configure Apache
126126
template: src="vhost.conf.j2" dest="/var/www/vhosts/{{ conf.domain_name }}/conf/vhost.conf" backup=yes
127127
become: true
128+
when: conf.domain_name is defined and (conf.https_only is not defined or not conf.https_only)
129+
notify:
130+
- Reconfigure Plesk domain
131+
- Restart Apache
132+
133+
- name: Configure Apache SSL
134+
template: src="vhost.conf.j2" dest="/var/www/vhosts/{{ conf.domain_name }}/conf/vhost_ssl.conf" backup=yes
135+
become: true
128136
when: conf.domain_name is defined
129137
notify:
130138
- Reconfigure Plesk domain

0 commit comments

Comments
 (0)