homelab/roles/gitea/tasks/main.yml
2022-05-26 21:51:41 -04:00

35 lines
798 B
YAML

- name: Create Gitea directory
file:
path: "{{ gitea_root }}"
state: directory
- name: Create gitea database
postgresql_db:
name: "{{ gitea_dbname }}"
become: true
become_user: postgres
- name: Create gitea database user
postgresql_user:
db: "{{ gitea_dbname }}"
name: "{{ gitea_dbuser }}"
password: "{{ gitea_dbpass }}"
become: true
become_user: postgres
- name: Install Gitea's docker-compose file
template:
src: docker-compose.yml.j2
dest: "{{ gitea_root }}/docker-compose.yml"
- name: Install Gitea's docker-compose variables
template:
src: compose-env.j2
dest: "{{ gitea_root }}/.env"
- name: Start and enable Gitea service
service:
name: "{{ docker_compose_service }}@{{ gitea_name }}"
state: started
enabled: true