-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_certbot.yaml
34 lines (33 loc) · 1.06 KB
/
install_certbot.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
---
- name: "Install letsencrypt with a cert for the bbbs site"
hosts: bbbsia
become: true
vars:
certbot_admin_email: [email protected]
certbot_create_if_missing: true
certbot_create_standalone_stop_services:
- bitnami
certbot_certs:
- domains:
- volunteers.bbbsia.org
roles:
- geerlingguy.certbot
tasks:
- name: "Update WP_SITEURL in wp-config to point to https"
replace:
path: /opt/bitnami/apps/wordpress/htdocs/wp-config.php
regexp: '(define.*WP_SITEURL.*)http://(.*)'
replace: '\1https://\2'
- name: "Update WP_HOME in wp-config to point to https"
replace:
path: /opt/bitnami/apps/wordpress/htdocs/wp-config.php
regexp: '(define.*WP_HOME.*)http://(.*)'
replace: '\1https://\2'
- name: "Enable Apache Redirects"
blockinfile:
path: /opt/bitnami/apps/wordpress/conf/httpd-prefix.conf
insertbefore: BOF
block: |
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [R,L]