homelab/roles/gitea/tasks/main.yml

35 lines
798 B
YAML
Raw Normal View History

- name: Create Gitea directory
file:
path: "{{ gitea_root }}"
state: directory
2020-07-28 03:20:50 +00:00
- name: Create Gitea database
postgresql_db:
2020-07-28 03:20:50 +00:00
name: "{{ gitea_dbname }}"
become: true
become_user: postgres
2020-07-28 03:20:50 +00:00
- 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"
2022-05-22 04:19:56 +00:00
- name: Start and enable Gitea service
service:
name: "{{ docker_compose_service }}@{{ gitea_name }}"
2022-05-22 04:19:56 +00:00
state: started
enabled: true