aboutsummaryrefslogtreecommitdiffstats
path: root/roles/cgit/tasks/main.yml
diff options
context:
space:
mode:
authorRomain Gonçalves <me@rgoncalves.se>2021-12-11 13:54:22 +0000
committerRomain Gonçalves <me@rgoncalves.se>2021-12-11 13:54:22 +0000
commite60e99796111ee6d43080b4e48971c08886c0570 (patch)
tree481e8fd119b3afdd0e2a2730ce1f41d623577e9e /roles/cgit/tasks/main.yml
parent48208c520bb15d16b0eab623b97fa5e86c6f665c (diff)
downloadrules-e60e99796111ee6d43080b4e48971c08886c0570.tar.gz
roles: Add git and cgit roles
Diffstat (limited to 'roles/cgit/tasks/main.yml')
-rw-r--r--roles/cgit/tasks/main.yml53
1 files changed, 53 insertions, 0 deletions
diff --git a/roles/cgit/tasks/main.yml b/roles/cgit/tasks/main.yml
new file mode 100644
index 0000000..6040ecf
--- /dev/null
+++ b/roles/cgit/tasks/main.yml
@@ -0,0 +1,53 @@
+- name: install cgit packages
+ package:
+ name:
+ - cgit
+ - lowdown
+ state: present
+
+- name: generate cgit configuration files
+ template:
+ src: "{{ item.template }}"
+ dest: "{{ item.file }}"
+ owner: 0
+ group: 0
+ mode: 0644
+ loop:
+ - template: cgitrc.j2
+ file: "{{ cgit_chroot_dir }}/conf/cgitrc"
+ - template: footer.html.j2
+ file: "{{ cgit_chroot_dir }}/conf/footer.html"
+ - template: httpd.conf.j2
+ file: /etc/httpd.d/cgit.conf
+
+- name: copy utilities in httpd chroot
+ copy:
+ src: "{{ item }}"
+ dest: "{{ cgit_chroot_dir }}/bin"
+ mode: preserve
+ remote_src: true
+ loop:
+ - /bin/sh
+ - /bin/cat
+ - /usr/local/bin/lowdown
+
+- name: copy about-filter generator
+ copy:
+ src: about-filter.sh
+ dest: "{{ cgit_chroot_dir }}/bin/about-filter.sh"
+ owner: 0
+ group: 0
+ mode: 0755
+
+- 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 "{{ cgit_chroot_dir }}/htpasswd/cgit"
+ when: cgit_authenticate
remember that computers suck.