Select Git revision
ansible.cfg
main.yml 3.01 KiB
---
# tasks file for ansible-cgit
- name: apt install
apt:
name: '{{ item }}'
state: present
update_cache: yes
cache_valid_time: 3600
with_items:
- cgit
- git
- apache2
- python-docutils
- cron
- name: Enable Apache modules
apache2_module:
name: '{{ item }}'
state: present
notify:
- Restart Apache
with_items:
- cgi
- ssl
- name: Disable default Apache site
file:
path: /etc/apache2/sites-enabled/000-default.conf
state: absent
notify:
- Restart Apache
- name: Add cgit Apache site
template:
src: cgit.conf.j2
dest: /etc/apache2/sites-enabled/cgit.conf
owner: root
group: root
mode: '0644'
notify:
- Restart Apache
- name: Create git repostories directory
file:
path: '{{ cgit_directory }}'
owner: root
group: root
mode: '0777'
state: directory
- name: Add symlink for rst2html (hack, fixed in Stretch)
when: ansible_distribution_major_version < 9
file:
src: /usr/share/docutils/scripts/python2/rst2html
dest: /usr/local/bin/rst2html.py
owner: root
group: root
state: link
- name: Configure cgit
lineinfile:
dest: /etc/cgitrc
line: '{{ item.line }}'
regexp: '{{ item.regexp|default(omit) }}'
insertbefore: '{{ item.insertbefore|default(omit) }}'
with_items:
- line: 'scan-path={{ cgit_directory }}'
regexp: 'scan-path='
- line: 'css=/cgit/css/cgit.css'