Add foundryvtt service
This commit is contained in:
parent
52c44da32e
commit
189f1972e2
8 changed files with 124 additions and 0 deletions
69
playbooks/roles/foundryvtt/defaults/main.yml
Normal file
69
playbooks/roles/foundryvtt/defaults/main.yml
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
---
|
||||
foundryvtt_release_url: "{{ undef() }}"
|
||||
foundryvtt_license_key: "{{ undef() }}"
|
||||
foundryvtt_admin_key: "{{ undef() }}"
|
||||
|
||||
foundryvtt_s3_bucket: "{{ opentofu.scaleway_data.foundryvtt.name }}"
|
||||
foundryvtt_s3_region: "{{ opentofu.scaleway_data.foundryvtt.region }}"
|
||||
foundryvtt_s3_api_endpoint: "{{ opentofu.scaleway_data.foundryvtt.api_endpoint }}"
|
||||
foundryvtt_s3_access_key: "{{ opentofu.scaleway_data.foundryvtt.access_key }}"
|
||||
foundryvtt_s3_secret_key: "{{ opentofu.scaleway_data.foundryvtt.secret_key }}"
|
||||
|
||||
foundryvtt_aws_config:
|
||||
buckets:
|
||||
- "{{ foundryvtt_s3_bucket }}"
|
||||
endpoint: "{{ foundryvtt_s3_api_endpoint }}"
|
||||
region: "{{ foundryvtt_s3_region }}"
|
||||
s3ForcePathStyle: true
|
||||
s3BucketEndpoint: false
|
||||
credentials:
|
||||
accessKeyId: "{{ foundryvtt_s3_access_key }}"
|
||||
secretAccessKey: "{{ foundryvtt_s3_secret_key }}"
|
||||
|
||||
foundryvtt_svc:
|
||||
domain: "{{ all_services | service_get_domain(service_name) }}"
|
||||
port: 30000
|
||||
caddy_extra: |
|
||||
handle_path /s3proxy/* {
|
||||
rewrite * /{{ foundryvtt_aws_config.buckets[0] }}{uri}
|
||||
reverse_proxy {{ foundryvtt_s3_api_endpoint }} {
|
||||
header_up Host {http.reverse_proxy.upstream.hostport}
|
||||
}
|
||||
}
|
||||
|
||||
handle_path /{{ foundryvtt_s3_bucket }}.{{ foundryvtt_s3_api_endpoint | urlsplit('hostname') }}/{{ foundryvtt_s3_bucket }}/* {
|
||||
rewrite * /{{ foundryvtt_aws_config.buckets[0] }}{uri}
|
||||
reverse_proxy {{ foundryvtt_s3_api_endpoint }} {
|
||||
header_up Host {http.reverse_proxy.upstream.hostport}
|
||||
}
|
||||
}
|
||||
|
||||
foundryvtt_env:
|
||||
FOUNDRY_RELEASE_URL: "{{ foundryvtt_release_url | mandatory }}"
|
||||
FOUNDRY_LICENSE_KEY: "{{ foundryvtt_license_key | mandatory }}"
|
||||
FOUNDRY_ADMIN_KEY: "{{ foundryvtt_admin_key | mandatory }}"
|
||||
|
||||
FOUNDRY_COMPRESS_WEBSOCKET: true
|
||||
FOUNDRY_MINIFY_STATIC_FILES: true
|
||||
|
||||
FOUNDRY_HOSTNAME: "{{ foundryvtt_svc.domain }}"
|
||||
FOUNDRY_PROXY_SSL: true
|
||||
FOUNDRY_PROXY_PORT: 443
|
||||
|
||||
FOUNDRY_LANGUAGE: de.lang-de
|
||||
FOUNDRY_TELEMETRY: true
|
||||
|
||||
FOUNDRY_AWS_CONFIG: aws.json
|
||||
|
||||
TZ: "{{ timezone }}"
|
||||
|
||||
|
||||
foundryvtt_compose:
|
||||
watchtower: update
|
||||
image: ghcr.io/felddy/foundryvtt:14
|
||||
volumes:
|
||||
- data:/data
|
||||
- ./aws.json:/data/Config/aws.json
|
||||
file:
|
||||
volumes:
|
||||
data:
|
||||
3
playbooks/roles/foundryvtt/handlers/main.yml
Normal file
3
playbooks/roles/foundryvtt/handlers/main.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
- name: Restart service foundryvtt
|
||||
ansible.builtin.include_tasks: tasks/restart-service.yml
|
||||
25
playbooks/roles/foundryvtt/tasks/main.yml
Normal file
25
playbooks/roles/foundryvtt/tasks/main.yml
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
---
|
||||
- name: Set common facts
|
||||
ansible.builtin.import_tasks: tasks/set-default-facts.yml
|
||||
|
||||
- name: Deploy {{ service_name }}
|
||||
vars:
|
||||
svc: "{{ foundryvtt_svc }}"
|
||||
env: "{{ foundryvtt_env }}"
|
||||
compose: "{{ foundryvtt_compose }}"
|
||||
block:
|
||||
- name: Import prepare tasks for common service
|
||||
ansible.builtin.import_tasks: tasks/prepare-common-service.yml
|
||||
|
||||
- name: Create aws config
|
||||
ansible.builtin.copy:
|
||||
dest: "{{ (service_path, 'aws.json') | path_join }}"
|
||||
content: "{{ foundryvtt_aws_config | to_json }}"
|
||||
owner: 1000
|
||||
group: 1000
|
||||
mode: 0644
|
||||
become: true
|
||||
notify: Restart service {{ service_name }}
|
||||
|
||||
- name: Import start tasks for common service
|
||||
ansible.builtin.import_tasks: tasks/start-common-service.yml
|
||||
Loading…
Add table
Add a link
Reference in a new issue