2022-05-27 02:26:35 +00:00
|
|
|
- name: Create Gitea directory
|
|
|
|
file:
|
|
|
|
path: "{{ gitea_root }}"
|
|
|
|
state: directory
|
2020-07-28 03:20:50 +00:00
|
|
|
|
2022-05-27 02:26:35 +00:00
|
|
|
- name: Create gitea database
|
|
|
|
postgresql_db:
|
2020-07-28 03:20:50 +00:00
|
|
|
name: "{{ gitea_dbname }}"
|
2022-05-27 02:26:35 +00:00
|
|
|
become: true
|
|
|
|
become_user: postgres
|
2020-07-28 03:20:50 +00:00
|
|
|
|
2022-05-27 02:26:35 +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
|
|
|
|
2022-05-27 02:26:35 +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
|
2022-05-27 02:26:35 +00:00
|
|
|
enabled: true
|