2023-10-04 13:28:05 +02:00
|
|
|
---
|
|
|
|
- include_role: name=system_user
|
|
|
|
vars:
|
|
|
|
the_user: "{{ hedy_user_username }}"
|
|
|
|
the_group: "{{ hedy_user_groupname }}"
|
|
|
|
the_home: "{{ hedy_base_path }}"
|
|
|
|
|
|
|
|
- name: Ensure Hedy paths exist
|
|
|
|
ansible.builtin.file:
|
|
|
|
path: "{{ item.path }}"
|
|
|
|
state: directory
|
|
|
|
mode: 0700
|
|
|
|
owner: "{{ hedy_user_username }}"
|
|
|
|
group: "{{ hedy_user_groupname }}"
|
|
|
|
with_items:
|
|
|
|
- {path: "{{ hedy_base_path }}", when: true}
|
|
|
|
- {path: "{{ hedy_data_path }}", when: true}
|
|
|
|
when: "item.when | bool"
|
|
|
|
|
2024-01-05 15:29:57 +01:00
|
|
|
- name: Ensure database file exists before mounting it
|
|
|
|
ansible.builtin.copy:
|
|
|
|
force: false
|
|
|
|
content: ""
|
|
|
|
dest: "{{ hedy_data_path }}/dev_database.json"
|
|
|
|
mode: 0600
|
|
|
|
owner: "{{ hedy_user_username }}"
|
|
|
|
group: "{{ hedy_user_groupname }}"
|
|
|
|
|
2023-11-04 16:36:26 +01:00
|
|
|
- delegate_to: "{{ hedy_builder_host }}"
|
2024-01-01 21:06:27 +01:00
|
|
|
when: "hedy_pull and hedy_container_image_self_build | bool"
|
2023-11-04 16:36:26 +01:00
|
|
|
become: true
|
|
|
|
become_user: "{{ hedy_builder_username }}"
|
|
|
|
block:
|
|
|
|
- include_tasks: "build-hedy.yml"
|
2023-10-04 13:28:05 +02:00
|
|
|
|
|
|
|
- name: Hedy container running
|
|
|
|
community.docker.docker_container:
|
|
|
|
name: "hedy"
|
2023-11-04 16:46:06 +01:00
|
|
|
comparisons:
|
|
|
|
env: strict
|
2023-10-04 13:28:05 +02:00
|
|
|
image: "{{ hedy_docker_image }}"
|
2023-11-04 16:36:26 +01:00
|
|
|
pull: "{{ hedy_pull and hedy_docker_image.endswith(':latest') }}"
|
2023-10-04 13:28:05 +02:00
|
|
|
restart_policy: unless-stopped
|
|
|
|
published_ports:
|
|
|
|
- "8080:8080"
|
|
|
|
volumes:
|
2023-11-04 16:36:26 +01:00
|
|
|
- "{{ hedy_data_path }}/dev_database.json:/app/dev_database.json"
|
2023-10-04 13:28:05 +02:00
|
|
|
env:
|
|
|
|
BASE_URL: "{{ hedy_base_url }}"
|
|
|
|
# https://github.com/hedyorg/hedy/wiki/Hedy-Development-Process#environment-variables
|
|
|
|
fix_for_weblate: "true"
|
|
|
|
save_snippet_hashes: "true"
|
2023-11-04 16:46:06 +01:00
|
|
|
ADMIN_USER: "{{ hedy_admin_user|default(omit,omit) }}"
|