ansible/roles/gitweb/tasks/main.yml
2020-02-20 05:29:27 -06:00

32 lines
840 B
YAML

#!/usr/bin/ansible-playbook
# vim:ft=ansible:
---
- name: Set up webroot for {{ gitweb_repo }}
block:
- name: Set up Apache
block:
- name: Create webroot
file:
path: "{{ gitweb_webroot }}"
mode: "0755"
state: directory
- name: Clone repo
git:
repo: "{{ gitweb_repo }}"
dest: "{{ gitweb_webroot }}"
- name: Copy over virtual host configs
template:
src: apache2-vhost-ssl.conf
dest: "/etc/apache2/sites-enabled/{{ gitweb_url }}.conf"
- name: Generate certificate
include_role:
name: https
vars:
website_url: "{{ gitweb_url }}"
website_webroot: "{{ gitweb_webroot }}"
- name: Reload Apache
service:
name: apache2
state: reloaded
become: yes