Browse Source

add admin user

master
vincent 2 months ago
parent
commit
3e8716c8d8
  1. 2
      defaults/main.yml
  2. 18
      tasks/main.yml
  3. 4
      templates/drone.env.j2

2
defaults/main.yml

@ -8,7 +8,7 @@ drone_gitea_always_auth: TRUE
drone_RPC_secret: secret
drone_server_host: toto:80
drone_server_proto: http
drone_user: admin
drone_db_external: FALSE
drone_db_host: 127.0.0.1:5432
drone_db_name: drone

18
tasks/main.yml

@ -7,22 +7,21 @@
- name: copy environment variable file
template:
src: drone.env.j2
dest: "{{drone_env_file_path}}"
src: drone.env.j2
dest: "{{drone_env_file_path}}"
- name: create drone container
docker_container:
volumes:
- "/var/lib/drone:/data"
docker_container:
volumes:
- "/var/lib/drone:/data"
name: "{{ drone_container_name }}"
image: "{{ drone_image_name }}"
state: started
env_file: "{{drone_env_file_path}}"
restart: yes
restart_policy: 'unless-stopped'
restart_policy: "unless-stopped"
published_ports: "{{ drone_port }}"
- name: create drone docker runner container
docker_container:
name: "{{ drone_runner_container_name }}"
@ -30,6 +29,5 @@
state: started
env_file: "{{drone_env_file_path}}"
restart: yes
restart_policy: 'unless-stopped'
restart_policy: "unless-stopped"
volumes: "{{ drone_docker_socket }}:/var/run/docker.sock"

4
templates/drone.env.j2

@ -9,6 +9,6 @@ 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=postgres
DRONE_DATABASE_DATASOURCE=postgres://{{drone_db_user}}:{{drone_db_password|urlencode()}}@{{drone_db_host}}/{{drone_db_name}}?sslmode=disable
DRONE_DATABASE_DATASOURCE=postgres://{{drone_db_user}}:{{drone_db_password|urlencode()}}@{{drone_db_host}}/{{drone_db_name}}?sslmode=disable
{% endif%}
DRONE_USER_CREATE=username:{{drone_user}},admin:true
Loading…
Cancel
Save