finalize drone role

This commit is contained in:
vincent 2021-04-18 16:14:56 +02:00
parent 2dce13ce15
commit 4a0048ef65
4 changed files with 13 additions and 8 deletions

View File

@ -5,17 +5,16 @@ drone_gitea_server: https://giteaserver
drone_gitea_client_id: "99999999"
drone_gitea_client_secret: secret
drone_gitea_always_auth: TRUE
drone_gitea_proto: http
drone_RPC_secret: secret
drone_server_host: toto:80
drone_server_proto: http
drone_db_external: TRUE
drone_db_external: FALSE
drone_db_host: 127.0.0.1:5432
drone_db_name: drone
drone_db_user: drone
drone_db_password: lel
drone_SQl_target_file: []
drone_SQl_target_file: /sql/save/path/drone.sql
drone_port:
- "80:80"

View File

@ -18,6 +18,10 @@
state: present
register: drone_database_creation
- name: check if SQL save file exist
stat:
path: "{{ drone_SQL_target_file }}"
register: drone_SQL_target_file_stat
- name: import DATA in database in case of creation
become: yes
@ -27,4 +31,4 @@
state: restore
target: "{{ drone_SQl_target_file }}"
register: drone_database_import
when: drone_database_creation.changed == true and drone_SQl_target_file is defined
when: drone_database_creation.changed == true and drone_SQL_target_file_stat.stat.exists == true

View File

@ -11,7 +11,9 @@
dest: "{{drone_env_file_path}}"
- name: create drone container
docker_container:
docker_container:
volumes:
- "/var/lib/drone:/data"
name: "{{ drone_container_name }}"
image: "{{ drone_image_name }}"
state: started

View File

@ -4,11 +4,11 @@ DRONE_GITEA_CLIENT_SECRET={{drone_gitea_client_secret}}
DRONE_GITEA_ALWAYS_AUTH={{drone_gitea_always_auth}}
DRONE_RPC_SECRET={{drone_RPC_secret}}
DRONE_RPC_HOST={{drone_server_host}}
DRONE_RPC_PROTO={{drone_gitea_proto}}
DRONE_RPC_PROTO={{drone_server_proto}}
DRONE_SERVER_HOST={{drone_server_host}}
DRONE_SERVER_PROTO={{drone_server_proto}}
{% if drone_db_external and drone_db_host and drone_db_name and drone_db_name %}
DRONE_DATABASE_DRIVER= postgress
DRONE_DATABASE_DATASOURCE=postgress://{{drone_db_user}}:{{drone_db_password|urlencode()}}@{{drone_db_host}}/{{drone_db_name}}?sslmode=disable
DRONE_DATABASE_DRIVER=postgres
DRONE_DATABASE_DATASOURCE=postgres://{{drone_db_user}}:{{drone_db_password|urlencode()}}@{{drone_db_host}}/{{drone_db_name}}?sslmode=disable
{% endif%}