ansible/roles/desktop/tasks/apache.yml
2020-07-12 10:01:57 -05:00

29 lines
827 B
YAML

#!/usr/bin/ansible-playbook
# vim:ft=ansible:
---
- name: Set up local Apache
block:
- name: Set up Apache
block:
- name: Create webroot
file:
path: "/var/www/localhost"
mode: "0755"
state: directory
- name: Clone repo
git:
repo: "{{ desktop_web_repo }}"
dest: "/var/www/localhost"
notify: restart apache
- name: Copy over virtual host configs
template:
src: apache2-vhost.conf
dest: "/etc/apache2/sites-available/localhost.conf"
notify: restart apache
- name: Enable config
command:
cmd: "a2ensite localhost.conf"
creates: "/etc/apache2/sites-enabled/localhost.conf"
notify: restart apache
become: yes