blob: 6a33521c02ec8a7028d8b99ceb777dd0a8ca2f40 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
---
- name: apt install cgit and fcgiwrap
become: yes
apt: name="{{item}}"
loop:
- "cgit"
- "fcgiwrap"
- "git"
- "python3-pygments"
notify: restart fcgiwrap
- name: configure cgit
become: yes
template: src="cgitrc.j2" dest="/etc/cgitrc"
notify: restart fcgiwrap
- name: make /etc/cgit dir
become: yes
file: path="/etc/cgit" state="directory"
when: cgit_header_src is defined or cgit_footer_src is defined
- name: install cgit custom css
become: yes
copy: src="{{cgit_css_src}}" dest="/usr/share/cgit/cgit-custom.css"
when: cgit_css_src is defined
notify: restart nginx
- name: install cgit header
become: yes
copy: src="{{cgit_header_src}}" dest="/etc/cgit/header.html"
when: cgit_header_src is defined
notify: restart fcgiwrap
- name: install cgit footer
become: yes
copy: src="{{cgit_footer_src}}" dest="/etc/cgit/footer.html"
when: cgit_footer_src is defined
notify: restart fcgiwrap
- name: set cgit repo owners
become: yes
shell: |
for repo in {{cgit_scan_path}}*/; do
git config --file "${repo}config" gitweb.owner "{{cgit_owner}}"
done
when: cgit_owner is defined
changed_when: true
- name: install cgit nginx site
become: yes
template: src="cgit.nginx.conf.j2" dest="/etc/nginx/sites-available/cgit.conf"
notify: restart nginx
- name: enable cgit nginx site
become: yes
file:
src: "/etc/nginx/sites-available/cgit.conf"
dest: "/etc/nginx/sites-enabled/cgit.conf"
state: "link"
notify: restart nginx
- name: ensure fcgiwrap service is started
become: yes
systemd: name="fcgiwrap.service" enabled="yes" state="started"
|