--- - name: install packages apk: name: - lighttpd - git-gitweb - highlight - perl-cgi state: present - name: main block vars: lighttpd_user: lighttpd lighttpd_group: lighttpd http_port: 80 gitweb_user: gitweb gitweb_root: /home/gitweb/projects gitweb_stylesheet: custom_highlighting.css block: - name: add gitweb user user: name: "{{ gitweb_user }}" - name: create project directory file: path: "{{ gitweb_root }}" state: directory owner: "{{ gitweb_user }}" - name: install lighttpd template template: src: lighttpd.conf.j2 dest: /etc/lighttpd/lighttpd.conf - name: install gitweb template template: src: gitweb.conf.j2 dest: /etc/gitweb.conf - name: install gitweb stylesheet template: src: "{{ gitweb_stylesheet }}.j2" dest: "/usr/share/gitweb/static/{{ gitweb_stylesheet }}" - name: enable and (re)start lighttpd service: name: lighttpd enabled: yes state: restarted