--- - name: Install gitea package ansible.builtin.xbps: pkg: - gitea - python3-dnspython - python3-psycopg2 state: present - name: add dns entry community.general.nsupdate: key_name: "ansible" key_secret: "{{ dns_tsig_key }}" key_algorithm: "hmac-sha512" server: "127.0.0.1" zone: "cosmosim.dev" record: "{{ gitea_domain }}." type: "CNAME" value: "cosmosim.dev." state: present - name: Create _gitea role community.postgresql.postgresql_user: name: _gitea state: present become: true become_user: postgres - name: Create postgres database community.postgresql.postgresql_db: name: gitea owner: _gitea state: present become: true become_user: postgres - name: Create run directory ansible.builtin.file: path: /run/gitea owner: _gitea group: _gitea mode: 0750 state: directory - name: Set run dir acl ansible.posix.acl: path: /run/gitea entity: caddy etype: user permissions: rX state: present - name: Set run dir acl ansible.posix.acl: path: /run/gitea entity: caddy etype: user permissions: rw default: true state: present - name: Upload gitea.conf ansible.builtin.template: src: templates/gitea.conf.j2 dest: /etc/gitea.conf owner: root group: _gitea mode: 0640 notify: - Restart gitea - name: Enable gitea Service runit: name: gitea enabled: true