暫無描述
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

cgit.yml 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. - name: Install cgit dependencies
  2. apt: pkg={{ item }} state=installed
  3. with_items:
  4. - groff
  5. - libssl-dev
  6. - python-pip
  7. - name: Install cgit pip dependencies
  8. pip: name={{ item }}
  9. with_items:
  10. - docutils
  11. - pygments
  12. - name: Download cgit release
  13. get_url: url=http://git.zx2c4.com/cgit/snapshot/cgit-{{ cgit_version }}.tar.xz
  14. dest=/root/cgit-{{ cgit_version }}.tar.xz
  15. - name: Decompress cgit source
  16. command: tar xvfJ /root/cgit-{{ cgit_version }}.tar.xz
  17. chdir=/root
  18. creates=/root/cgit-{{ cgit_version }}/configure
  19. - name: Build and install cgit
  20. shell: make get-git ; make ; make install
  21. executable=/bin/bash
  22. chdir=/root/cgit-{{ cgit_version }}
  23. creates=/var/www/htdocs/cgit/cgit.cgi
  24. - name: Copy cgitrc
  25. template: src=etc_cgitrc.j2 dest=/etc/cgitrc
  26. group=www-data
  27. owner=www-data
  28. - name: Rename existing Apache cgit virtualhost
  29. command: mv /etc/apache2/sites-available/cgit /etc/apache2/sites-available/cgit.conf removes=/etc/apache2/sites-available/cgit
  30. - name: Remove old sites-enabled/cgit symlink (new one will be created by a2ensite)
  31. command: rm /etc/apache2/sites-enabled/cgit removes=/etc/apache2/sites-enabled/cgit
  32. - name: Configure the Apache HTTP server for cgit
  33. template: src=etc_apache2_sites-available_cgit.j2
  34. dest=/etc/apache2/sites-available/cgit.conf
  35. group=root
  36. owner=root
  37. - name: Enable Apache cgi module
  38. command: a2enmod cgi creates=/etc/apache2/mods-enabled/cgi.load
  39. notify: restart apache
  40. - name: Enable Apache rewrite module
  41. command: a2enmod rewrite creates=/etc/apache2/mods-enabled/rewrite.load
  42. notify: restart apache
  43. - name: Enable cgit site
  44. command: a2ensite cgit.conf creates=/etc/apache2/sites-enabled/cgit.conf
  45. notify: restart apache