aboutsummaryrefslogtreecommitdiffstats
path: root/roles/cgit/tasks/main.yml
blob: 6b52bd7a89be258453a8516dce50765cb6adebd4 (plain) (blame)
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80

# cgit ~~ roles/cgit/tasks/main.yml
# cgit web interface

---

- name: ensure cgit is installed
  package:
    name: cgit
    state: present

- name: generate cgit configuration file
  template:
    src: var-www-conf-cgitrc.j2
    dest: /var/www/conf/cgitrc
    owner: "0"
    group: "0"
    mode: "0644"

- name: generate cgit configuration for httpd
  template:
    src: etc-httpd.d-cgit.conf.j2
    dest: /etc/httpd.d/cgit.conf
    owner: "0"
    group: "0"
    mode: "0644"

- name: copy utility in httpd chroot
  copy:
    src: "/bin/{{ item }}"
    dest: /var/www/bin
    mode: preserve
    remote_src: true
  loop:
    - "sh"
    - "cat"

- name: copy about-filter generator
  copy:
    src: about-filter.sh
    dest: /var/www/bin/about-filter.sh
    owner: "0"
    group: "0"
    mode: "0755"

- name: ensure cgit web directory exists
  file:
    path: /var/www/{{ cgit_git_dir_chroot }}
    owner: "{{ cgit_user }}"
    group: daemon
    state: directory
    mode: "0755"

- name: include nfsclient for remote dir
  include_role:
    name: nfsclient
  vars:
    nfsclient_dir: "/var/www/{{ cgit_git_dir_chroot }}"
    nfsclient_server_dir: "{{ global.nfs_server_dir }}/{{ ansible_host }}/git"
    #nfsclient_server: "{{ global.nfs_server }}"

- name: chown git directory to git
  file:
    path: /data/git
    owner: "{{ cgit_user }}"
    group: "{{ cgit_group }}"
    state: directory

- name: start and enable slowcgi service
  service:
    name: slowcgi
    state: restarted
    enabled: true

- name: httpd password information
  debug:
    msg: | 
      Please provide a password using htpasswd,
      in /htpasswd/cgit
  when: cgit_authenticate
remember that computers suck.