mirror of
https://github.com/davestephens/ansible-nas
synced 2024-11-16 08:48:04 +00:00
74 lines
1.7 KiB
YAML
74 lines
1.7 KiB
YAML
---
|
|
- name: Create Gitea group account
|
|
group:
|
|
name: git
|
|
gid: 1309
|
|
state: present
|
|
|
|
- name: Create Gitea user account
|
|
user:
|
|
name: git
|
|
uid: 1309
|
|
state: present
|
|
system: yes
|
|
update_password: on_create
|
|
create_home: no
|
|
group: git
|
|
|
|
- name: Create Gitea Directories
|
|
file:
|
|
path: "{{ item }}"
|
|
state: directory
|
|
owner: git
|
|
group: git
|
|
recurse: yes
|
|
with_items:
|
|
- "{{ gitea_data_directory }}/gitea"
|
|
- "{{ gitea_data_directory }}/mysql"
|
|
|
|
- name: Create MySQL container for Gitea
|
|
docker_container:
|
|
name: gitea-mysql
|
|
image: mysql:5.7
|
|
pull: true
|
|
volumes:
|
|
- "{{ gitea_data_directory }}/mysql:/var/lib/mysql:rw"
|
|
env:
|
|
MYSQL_DATABASE: "gitea"
|
|
MYSQL_USER: "gitea"
|
|
MYSQL_PASSWORD: "gitea"
|
|
MYSQL_ROOT_PASSWORD: "gitea"
|
|
restart_policy: unless-stopped
|
|
memory: 1g
|
|
|
|
- name: Create Gitea container
|
|
docker_container:
|
|
name: gitea
|
|
image: gitea/gitea:1.6
|
|
pull: true
|
|
links:
|
|
- gitea-mysql:db
|
|
volumes:
|
|
- "{{ gitea_data_directory }}/gitea:/data:rw"
|
|
ports:
|
|
- "{{ gitea_port_http }}:3000"
|
|
- "{{ gitea_port_ssh }}:22"
|
|
env:
|
|
DB_TYPE: "mysql"
|
|
DB_HOST: "db:3306"
|
|
DB_NAME: "gitea"
|
|
DB_USER: "gitea"
|
|
DB_PASSWD: "gitea"
|
|
RUN_MODE: "prod"
|
|
SSH_DOMAIN: "{{ ansible_nas_hostname }}"
|
|
SSH_PORT: "{{ gitea_port_ssh }}"
|
|
ROOT_URL: "http://{{ ansible_nas_hostname }}:{{ gitea_port_http }}/"
|
|
USER_UID: "1309"
|
|
USER_GID: "1309"
|
|
restart_policy: unless-stopped
|
|
memory: 1g
|
|
labels:
|
|
traefik.backend: "gitea"
|
|
traefik.frontend.rule: "Host:gitea.{{ ansible_nas_domain }}"
|
|
traefik.enable: "{{ gitea_available_externally }}"
|
|
traefik.port: "3000"
|