aboutsummaryrefslogtreecommitdiffstats
path: root/roles/git/tasks/cgit.yml
blob: 5c4663ae6aec27733286726627bcfa38f45c4205 (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

- name: Install cgit package and deps (fcgi stuff)
  apt: pkg={{ item }} state=installed
  with_items:
    - cgit
    - fcgiwrap
    - spawn-fcgi
  tags:
    - dependencies

- name: Create dir to work around bug in debian jessie cgit
  when: (ansible_distribution == "Debian" and ansible_distribution_major_version == "8")
  file: state=directory
        path=/var/cache/cgit
        group=www-data
        owner=www-data
        mode=0775

- name: Copy cgitrc
  template: src=etc_cgitrc.j2 dest=/etc/cgitrc
            group=www-data
            owner=root

- name: Create static files directory
  file: path=/srv/http/cgit
        state=directory
        owner=www-data
        group=www-data
        mode=0775
        recurse=yes
  notify: fcgiwrap restart

- name: Upload Custom cgit Static Files (css, robots.txt, logo, etc)
  copy: src={{ item.src }} dest={{ item.dest }}
            group=www-data
            owner=www-data
  with_items:
    - { src: 'robots.txt',  dest: '/srv/http/cgit/robots.txt'   }
    - { src: 'cgit.png',    dest: '/srv/http/cgit/cgit.png'     }
    - { src: 'cgit.css',    dest: '/srv/http/cgit/cgit.css'     }
    - { src: 'favicon.ico', dest: '/srv/http/cgit/favicon.ico'  }

- name: Configure the nginx HTTP server for cgit
  template: src=etc_nginx_sites-available_cgit.j2
            dest=/etc/nginx/sites-available/cgit
            group=root
            owner=root

- name: Create symlink to enable cgit config
  file: state=link
        src=/etc/nginx/sites-available/cgit
        dest=/etc/nginx/sites-enabled/cgit
  notify: nginx reload