diff options
author | binary <me@rgoncalves.se> | 2021-01-17 19:21:43 +0100 |
---|---|---|
committer | binary <me@rgoncalves.se> | 2021-01-17 19:22:13 +0100 |
commit | f83652e0e723af7afbeb3494ed888db76d5efa82 (patch) | |
tree | c0d11d4ededb8c3b1804e2bb9d8f05b67ad05bf8 /roles/cgit/tasks | |
parent | 58a81dc2ea748cf769d88b7515a39c6587d37ce2 (diff) | |
download | infrastructure-f83652e0e723af7afbeb3494ed888db76d5efa82.tar.gz |
Add cgit deploiement role with configuration
Diffstat (limited to 'roles/cgit/tasks')
-rw-r--r-- | roles/cgit/tasks/main.yml | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/roles/cgit/tasks/main.yml b/roles/cgit/tasks/main.yml index 3a20a59..424a07e 100644 --- a/roles/cgit/tasks/main.yml +++ b/roles/cgit/tasks/main.yml @@ -9,6 +9,86 @@ name: cgit state: present +- name: generate cgit configuration file + template: + src: cgitrc.j2 + dest: /var/www/conf/cgitrc + owner: "{{ user_root }}" + group: "{{ group_root }}" + mode: 0644 + +- name: generate cgit configuration for httpd + template: + src: cgit.httpd.conf.j2 + dest: /etc/httpd.d/cgit.conf + owner: "{{ user_root }}" + group: "{{ group_root }}" + mode: 0644 + +- name: copy utility in httpd chroot + copy: + src: "/bin/{{ item }}" + dest: /var/www/bin + remote_src: true + loop: + - "sh" + - "cat" + +- name: copy about-filter generator + copy: + src: about-filter.sh + dest: /var/www/bin/about-filter.sh + owner: "{{ user_root }}" + group: "{{ group_root }}" + mode: 0755 + +- name: unmount potential existing filesystem in target directory + shell: "umount /var/www/{{ cgit_git_dir_chroot }}" + +- name: ensure cgit web directory exists + file: + path: /var/www/{{ cgit_git_dir_chroot }} + owner: www + group: daemon + mode: 0644 + state: directory + +- name: enable shared git directory in /etc/exports + lineinfile: + path: /etc/exports + regexp: "^{{ cgit_git_dir }}" + line: "{{ cgit_git_dir }} -mapall=root -alldirs -network=127.0.0.1 -mask=255.255.255.255 -ro" + owner: "{{ user_root }}" + group: "{{ group_root }}" + mode: 0644 + create: true + +- name: enable shared git directory in /etc/exports + lineinfile: + path: /etc/fstab + regexp: "^localhost:{{ cgit_git_dir }}" + line: "localhost:{{ cgit_git_dir }} /var/www/{{ cgit_git_dir_chroot }} nfs rw,nodev,nosuid,soft,intr 0 0" + +- name: start and enable share directory + service: + name: "{{ item }}" + state: restarted + enabled: true + loop: + - "portmap" + - "nfsd" + +- name: start and enable mountd + shell: | + rcctl enable mountd + pkill -9 mountd + rcctl start mountd + +- name: ensure nfs volume is mounted + shell: mount -A + register: result + failed_when: result.rc != 0 and "Device busy" is not in result.stderr + - name: start and enable slowcgi service service: name: slowcgi |