This repository has been archived on 2020-08-09. You can view files and clone it, but cannot push or open issues or pull requests.
ansible-gitea/tasks/main.yml

48 lines
1.4 KiB
YAML

- name: Include sensitive info
include_vars:
dir: '{{ role_path }}/vault'
tags:
- gitea
- vault
- name: Fetch Gitea gpg key
command:
argv:
- "gpg"
- "--recv"
- "7C9E68152594688862D62AF62D9AE806EC1592E2"
tags:
- gitea
- keys
- packages
- name: Download Gitea binary signature
get_url:
url: "https://dl.gitea.io/gitea/master/gitea-master-linux-amd64.asc"
dest: "/tmp/gitea-master-linux-amd64.asc"
tags:
- gitea
- keys
- packages
- name: Download Gitea binary
get_url:
url: "https://dl.gitea.io/gitea/master/gitea-master-linux-amd64"
dest: "/usr/local/bin/gitea" # TODO: Don't update the binary unless the GPG check passes
checksum: "sha256:https://dl.gitea.io/gitea/master/gitea-master-linux-amd64.sha256"
mode: "+x"
tags:
- gitea
- packages
notify: Verify binary with gpg
- name: Copy templates
loop:
- { src: "gitea.service", dest: "/etc/systemd/system/gitea.service", owner: "{{ gitea.user }}", mode: "600" }
- { src: "gitea.ini", dest: "/etc/gitea/app.ini", owner: "{{ gitea.user }}", mode: "600" }
template:
follow: yes
src: "{{ item.src }}.j2"
dest: "{{ item.dest }}"
mode: "{{ item.mode }}"
owner: "{{ item.owner }}"
tags:
- gitea
notify: Run service actions