You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.3 KiB
YAML

---
- name: Create instance directory
file:
state: directory
path: "{{ instance_directory }}"
owner: root
group: root
mode: u=rwx,g=rx,o=
- name: Create general data directory
file:
state: directory
path: "{{ data_directory }}"
owner: root
group: root
mode: u=rwx,g=rx,o=
- name: Create data directory for drone volume
file:
state: directory
path: "{{ drone_data_directory }}"
# let docker/drone.io manage control permissions
- name: Start drone server using docker-compose
docker_compose:
state: present
project_name: "{{ domain }}"
definition:
version: '2'
services:
drone-server:
image: "{{ docker_image }}"
restart: always
environment:
DRONE_DATABASE_SECRET: "{{ drone_database_secret }}"
DRONE_GITEA_SERVER: "{{ gitea_server_url }}"
DRONE_GITEA_CLIENT_ID: "{{ gitea_client_id }}"
DRONE_GITEA_CLIENT_SECRET: "{{ gitea_client_secret }}"
DRONE_RPC_SECRET: "{{ drone_rpc_secret }}"
DRONE_SERVER_HOST: "{{ domain }}"
DRONE_SERVER_PROTO: https
DRONE_USER_CREATE: "username:{{ drone_admin_user }},admin:true"
ports:
- "127.0.0.1:{{ bind_port }}:80" # for nginx reverse proxy
volumes:
- "{{ data_directory }}:/data"