summaryrefslogtreecommitdiff
path: root/roles/cgit/tasks/main.yml
blob: 49deb2314360862efc89ed3cd396bdafa157802e (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
---
- name: Ensure cgit directory exists
  file: path={{ apache_root }}/cgit state=directory mode=0755 owner=root group=root

- name: Ensure cgit css directory exists
  file: path={{ apache_root }}/cgit/cgit-css state=directory mode=0755

- name: Install cgitrc file
  template: src=cgitrc dest=/etc/cgitrc

- name: Install cgit dependencies
  apt: name={{ item }}
  with_items:
    - gcc
    - libssl-dev
    - make
    - python3-markdown
    - python3-docutils

# cgit isn't available in Trusty and we have patches not available in Xenial,
# so we install this by hand in the most idempotent way we can:
- name: Clone cgit repository
  git:  name=https://{{ linaro_git_server }}/infrastructure/cgit
        dest={{ tools_checkout_dir }}/cgit
        version="linaro-patches" track_submodules=no
  notify:
    - build-cgit

- name: Link cgit css into apache directory
  file: src={{ tools_checkout_dir }}/cgit/cgit.css
        dest={{ apache_root }}/cgit/cgit-css/cgit.css
        state=link

- name: Copy the site logo
  copy: src=git-logo.png dest={{ apache_root }}/cgit/cgit-css/ mode=0755

- name: Install header.html
  template: src=header.html dest={{ apache_root }}/cgit/header.html mode=0755

- name: Create a wrapper script to the cgit binary
  copy: dest={{ apache_root }}/cgit/cgit owner=root group=root mode=0755
        content="#!/bin/sh\n{{ tools_checkout_dir }}/cgit/cgit\n"

- name: Install git-http-backend suexec script
  template: src=git-http-backend.cgi
            dest={{ apache_root }}/cgit/git-http-backend.cgi
            mode=0755

- name: Create a symlink for rst2html.py
  file: src=/usr/bin/rst2html dest=/usr/bin/rst2html.py state=link

- name: Install authentication commands command (only used by private servers)
  template: src={{ item }} dest={{ apache_root }}/cgit/
            owner=root group=root mode=0755
  with_items:
    - allowed-repo.sh
    - allowed-repos.sh

- name: Install sudoers rule for private server
  template: src=sudoers dest=/etc/sudoers.d/cgit
            owner=root group=root mode=0755
            validate='visudo -cf %s'