aboutsummaryrefslogblamecommitdiffstats
path: root/roles/cgit/tasks/main.yml
blob: 286ffabfc2f8e55d9b06f6bafda93c1affe8c4a1 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11










                                   



















                                             
                  












                                      




                                            
              

                    






                                                                              





                                                                       




                                        

# cgit ~~ roles/cgit/tasks/main.yml
# cgit web interface

---

- name: ensure cgit is installed
  package:
    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
    mode: preserve
    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: ensure cgit web directory exists
  file:
    path: /var/www/{{ cgit_git_dir_chroot }}
    owner: www
    group: daemon
    mode: 0655
    state: directory

- name: include nfsclient for remote dir
  include_role:
    name: nfsclient
  vars:
    nfsclient_dir: "/var/www/{{ cgit_git_dir_chroot }}"
    nfsclient_server_dir: "{{ global.nfs_server_dir }}/{{ ansible_host }}/git"
    #nfsclient_server: "{{ global.nfs_server }}"

- 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
    state: restarted
    enabled: true
remember that computers suck.