feat(hedgedoc): add ansible role for deployment
This commit is contained in:
52
roles/hedgedoc/defaults/main/config.yml
Normal file
52
roles/hedgedoc/defaults/main/config.yml
Normal file
@ -0,0 +1,52 @@
|
||||
---
|
||||
hedgedoc_config_domain: ~
|
||||
hedgedoc_config_log_level: "info"
|
||||
hedgedoc_config_session_secret: ~
|
||||
hedgedoc_config_protocol_use_ssl: true
|
||||
hedgedoc_config_hsts_enable: true
|
||||
hedgedoc_config_csp_enable: true
|
||||
hedgedoc_config_cookie_policy: 'lax'
|
||||
hedgedoc_config_allow_free_url: true
|
||||
hedgedoc_config_allow_email_register: false
|
||||
hedgedoc_config_allow_anonymous: true
|
||||
hedgedoc_config_allow_gravatar: true
|
||||
hedgedoc_config_require_free_url_authentication: true
|
||||
hedgedoc_config_default_permission: 'full'
|
||||
|
||||
hedgedoc_config_db_username: hedgedoc
|
||||
hedgedoc_config_db_password: ~
|
||||
hedgedoc_config_db_database: hedgedoc
|
||||
hedgedoc_config_db_host: localhost
|
||||
hedgedoc_config_db_port: 5432
|
||||
hedgedoc_config_db_dialect: postgres
|
||||
|
||||
hedgedoc_config_database:
|
||||
username: "{{ hedgedoc_config_db_username }}"
|
||||
password: "{{ hedgedoc_config_db_password }}"
|
||||
database: "{{ hedgedoc_config_db_database }}"
|
||||
host: "{{ hedgedoc_config_db_host }}"
|
||||
port: "{{ hedgedoc_config_db_port | int }}"
|
||||
dialect: "{{ hedgedoc_config_db_dialect }}"
|
||||
hedgedoc_config_base:
|
||||
production:
|
||||
domain: "{{ hedgedoc_config_domain }}"
|
||||
loglevel: "{{ hedgedoc_config_log_level }}"
|
||||
sessionSecret: "{{ hedgedoc_config_session_secret }}"
|
||||
protocolUseSSL: "{{ hedgedoc_config_protocol_use_ssl }}"
|
||||
cookiePolicy: "{{ hedgedoc_config_cookie_policy }}"
|
||||
allowFreeURL: "{{ hedgedoc_config_allow_free_url }}"
|
||||
allowAnonymous: "{{ hedgedoc_config_allow_anonymous }}"
|
||||
allowEmailRegister: "{{ hedgedoc_config_allow_email_register }}"
|
||||
allowGravatar: "{{ hedgedoc_config_allow_gravatar }}"
|
||||
requireFreeURLAuthentication: >-2
|
||||
{{ hedgedoc_config_require_free_url_authentication }}
|
||||
defaultPermission: "{{ hedgedoc_config_default_permission }}"
|
||||
hsts:
|
||||
enable: "{{ hedgedoc_config_hsts_enable }}"
|
||||
csp:
|
||||
enable: "{{ hedgedoc_config_csp_enable }}"
|
||||
db: "{{ hedgedoc_config_database }}"
|
||||
hedgedoc_config: ~
|
||||
hedgedoc_full_config: >-2
|
||||
{{ hedgedoc_config_base | default({}, true)
|
||||
| combine(hedgedoc_config | default({}, true), recursive=True) }}
|
54
roles/hedgedoc/defaults/main/container.yml
Normal file
54
roles/hedgedoc/defaults/main/container.yml
Normal file
@ -0,0 +1,54 @@
|
||||
---
|
||||
hedgedoc_container_image_registry: quay.io
|
||||
hedgedoc_container_image_namespace: hedgedoc
|
||||
hedgedoc_container_image_name: hedgedoc
|
||||
hedgedoc_container_image_flavour: alpine
|
||||
hedgedoc_container_image_tag: ~
|
||||
hedgedoc_container_image: >-2
|
||||
{{
|
||||
([
|
||||
hedgedoc_container_image_registry,
|
||||
hedgedoc_container_image_namespace | default([], true),
|
||||
hedgedoc_container_image_name,
|
||||
] | flatten | join('/'))
|
||||
+ ':'
|
||||
+ hedgedoc_container_image_tag | default(
|
||||
hedgedoc_version + (
|
||||
((hedgedoc_container_image_flavour is string)
|
||||
and (hedgedoc_container_image_flavour | length > 0))
|
||||
| ternary('-' +
|
||||
hedgedoc_container_image_flavour | default('', true),
|
||||
''
|
||||
)
|
||||
),
|
||||
true
|
||||
)
|
||||
}}
|
||||
hedgedoc_container_image_source: pull
|
||||
hedgedoc_container_name: hedgedoc
|
||||
hedgedoc_container_state: >-2
|
||||
{{ (hedgedoc_state == 'present') | ternary('started', 'absent') }}
|
||||
|
||||
hedgedoc_container_config_file: "/hedgedoc/config.json"
|
||||
hedgedoc_container_upload_path: "/hedgedoc/public/uploads"
|
||||
|
||||
hedgedoc_container_env: ~
|
||||
hedgedoc_container_user: >-2
|
||||
{{ hedgedoc_run_user_id }}:{{ hedgedoc_run_group_id }}
|
||||
hedgedoc_container_ports: ~
|
||||
hedgedoc_container_networks: ~
|
||||
hedgedoc_container_etc_hosts: ~
|
||||
hedgedoc_container_base_volumes:
|
||||
- "{{ hedgedoc_config_file }}:{{ hedgedoc_container_config_file }}:ro"
|
||||
- "{{ hedgedoc_uploads_path }}:{{ hedgedoc_container_upload_path }}:rw"
|
||||
hedgedoc_container_volumes: ~
|
||||
hedgedoc_container_all_volumes: >-2
|
||||
{{ hedgedoc_container_base_volumes | default([], true)
|
||||
+ hedgedoc_container_volumes | default([], true) }}
|
||||
hedgedoc_container_base_labels:
|
||||
version: "{{ hedgedoc_container_tag | default(hedgedoc_version, true) }}"
|
||||
hedgedoc_container_labels: ~
|
||||
hedgedoc_container_all_labels: >-2
|
||||
{{ hedgedoc_container_base_labels | default({}, true)
|
||||
| combine(hedgedoc_container_labels | default({}, true)) }}
|
||||
hedgedoc_container_restart_policy: "unless-stopped"
|
9
roles/hedgedoc/defaults/main/main.yml
Normal file
9
roles/hedgedoc/defaults/main/main.yml
Normal file
@ -0,0 +1,9 @@
|
||||
---
|
||||
hedgedoc_user: hedgedoc
|
||||
hedgedoc_version: 1.9.9
|
||||
|
||||
hedgedoc_state: present
|
||||
hedgedoc_deployment_method: docker
|
||||
|
||||
hedgedoc_config_file: "/etc/hedgedoc/config.json"
|
||||
hedgedoc_uploads_path: "/var/lib/hedgedoc-uploads"
|
5
roles/hedgedoc/defaults/main/user.yml
Normal file
5
roles/hedgedoc/defaults/main/user.yml
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
hedgedoc_run_user_id: >-2
|
||||
{{ hedgedoc_user_info.uid | default(hedgedoc_user }}
|
||||
hedgedoc_run_group_id: >-2
|
||||
{{ hedgedoc_user_info.group | default(hedgedoc_user }}
|
Reference in New Issue
Block a user