2020-02-11 04:06:29 -06:00
|
|
|
#!/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 }}"
|
2020-02-26 18:53:20 -06:00
|
|
|
notify: restart apache
|
2020-02-20 05:31:11 -06:00
|
|
|
- name: Copy over virtual host configs
|
|
|
|
template:
|
|
|
|
src: apache2-vhost-ssl.conf
|
2020-02-27 05:16:02 -06:00
|
|
|
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"
|
2020-02-26 18:53:20 -06:00
|
|
|
notify: restart apache
|
2020-09-11 11:56:46 -05:00
|
|
|
- name: Debug site name
|
|
|
|
debug:
|
|
|
|
msg: "{{ gitweb_url }} at {{ gitweb_webroot }} from {{ gitweb_repo }}"
|
2020-02-20 05:29:27 -06:00
|
|
|
- name: Generate certificate
|
|
|
|
include_role:
|
|
|
|
name: https
|
|
|
|
vars:
|
|
|
|
website_url: "{{ gitweb_url }}"
|
|
|
|
website_webroot: "{{ gitweb_webroot }}"
|
2020-02-11 04:06:29 -06:00
|
|
|
become: yes
|