ansible/roles/gitweb/tasks/main.yml
Salt 42f8c8aa35 Okay, turns out we need to separate out roles
This makes a bit more sense now, I guess
2020-09-11 11:56:46 -05:00

38 lines
1.1 KiB
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 }}"
notify: restart apache
- name: Copy over virtual host configs
template:
src: apache2-vhost-ssl.conf
dest: "/etc/apache2/sites-available/{{ gitweb_url }}.conf"
notify: restart apache
- name: Enable config
command:
cmd: "a2ensite {{ gitweb_url }}.conf"
creates: "/etc/apache2/sites-enabled/{{ gitweb_url }}.conf"
notify: restart apache
- name: Debug site name
debug:
msg: "{{ gitweb_url }} at {{ gitweb_webroot }} from {{ gitweb_repo }}"
- name: Generate certificate
include_role:
name: https
vars:
website_url: "{{ gitweb_url }}"
website_webroot: "{{ gitweb_webroot }}"
become: yes