22 lines
603 B
YAML
22 lines
603 B
YAML
#!/usr/bin/ansible-playbook
|
|
# vim:ft=ansible:
|
|
---
|
|
- name: Set up redirect
|
|
block:
|
|
- name: Copy over redirect config
|
|
template:
|
|
src: apache2-redirect.conf
|
|
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"
|
|
notify: restart apache
|
|
- name: Generate certificate
|
|
include_role:
|
|
name: https
|
|
vars:
|
|
website_url: "{{ redirect_from }}"
|
|
become: yes
|