--- - name: Setup git server hosts: raspberry tasks: - name: Install packages become: true tags: - slow apt: pkg: - nginx - certbot - python3-certbot-nginx - cgit - libfcgi-dev - spawn-fcgi - fcgiwrap # user - name: Create git user become: true shell: | useradd git -m mkdir /home/git/.ssh - name: Copy SSH keys become: true copy: src: ~/.ssh/id_rsa.pub dest: /home/git/.ssh/authorized_keys # nginx - name: Copy nginx configuration become: true copy: src: ./files/nginx/cgit dest: /etc/nginx/sites-available - name: Enable website become: true command: "ln -sf /etc/nginx/sites-available/cgit /etc/nginx/sites-enabled" - name: Install SSL certificate become: true shell: "certbot --nginx --non-interactive --agree-tos -m eugene@eug-vs.xyz -d git.eug-vs.xyz" - name: Restart and enable nginx become: true systemd: name: nginx enabled: yes state: restarted # cgit - name: Copy cgit configuration become: true copy: src: ./files/cgit/cgitrc dest: /etc # TODO: move this to eug-vs-xyz - name: Copy cgit styles become: true copy: src: ./files/cgit/cgit dest: /usr/share