2020-02-11 04:16:57 -06:00
|
|
|
#!/usr/bin/ansible-playbook
|
|
|
|
# vim:ft=ansible:
|
|
|
|
---
|
|
|
|
- name: Set up redirect
|
|
|
|
block:
|
2020-02-20 05:27:03 -06:00
|
|
|
- name: Copy over redirect config
|
|
|
|
template:
|
|
|
|
src: apache2-redirect.conf
|
2020-02-27 05:16:02 -06:00
|
|
|
dest: "/etc/apache2/sites-available/{{ redirect_from }}.conf"
|
|
|
|
notify: restart apache
|
|
|
|
- name: Enable config
|
|
|
|
command:
|
|
|
|
cmd: "a2ensite {{ redirect_from }}.conf"
|
|
|
|
creates: "/etc/apache2/sites-enabled/{{ redirect_from }}.conf"
|
2020-02-26 18:53:20 -06:00
|
|
|
notify: restart apache
|
2020-02-20 05:27:03 -06:00
|
|
|
- name: Generate certificate
|
|
|
|
include_role:
|
|
|
|
name: https
|
|
|
|
vars:
|
|
|
|
website_url: "{{ redirect_from }}"
|
2020-02-11 04:16:57 -06:00
|
|
|
become: yes
|