--- - name: install cgit and fcgiwrap apt: name: - cgit - python3-pygments - fcgiwrap state: present ### TODO: this might break stuff.. - name: mask default fcgiwrap systemd units loop: - socket - service systemd: name: "fcgiwrap.{{ item }}" state: stopped masked: yes - name: install fcgiwrap systemd units loop: "{{ gitolite_instances | dict2items | selectattr('value.http', 'defined') | product(['socket', 'service']) }}" loop_control: label: "{{ item.0.key }}.{{ item.1 }}" template: src: "fcgiwrap.{{ item.1 }}.j2" dest: "/etc/systemd/system/fcgiwrap-gitolite-{{ item.0.key }}.{{ item.1 }}" - name: make sure fcgiwrap systemd socket unit is enabled and started loop: "{{ gitolite_instances | dict2items | selectattr('value.http', 'defined') }}" loop_control: label: "{{ item.key }}" systemd: daemon_reload: yes name: "fcgiwrap-gitolite-{{ item.key }}.socket" state: started enabled: yes - name: generate cgitrc loop: "{{ gitolite_instances | dict2items | selectattr('value.http', 'defined') }}" loop_control: label: "{{ item.key }}" template: src: cgitrc.j2 dest: "{{ gitolite_base_path }}/{{ item.key }}/cgitrc" - name: create base directory for custom logos when: (gitolite_instances | dict2items | selectattr('value.http.logo', 'defined') | length) > 0 file: path: /usr/local/share/cgit state: directory - name: copy logo file loop: "{{ gitolite_instances | dict2items | selectattr('value.http.logo', 'defined') }}" loop_control: label: "{{ item.key }}" copy: src: "{{ item.value.http.logo }}" dest: "/usr/local/share/cgit/{{ item.key }}.png" - name: install nginx vhost loop: "{{ gitolite_instances | dict2items | selectattr('value.http', 'defined') }}" loop_control: loop_var: gitolite_instance label: "{{ gitolite_instance.key }}" include_tasks: nginx-vhost.yml