diff --git a/defaults/main.yml b/defaults/main.yml index 6f340a9..7db6f72 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -6,7 +6,7 @@ hedy_admin_user: ~ hedy_user_username: hedy hedy_user_groupname: hedy hedy_base_path: /home/hedy -hedy_data_path: /home/hedy/data +hedy_data_path: "{{ hedy_base_path }}/data" # Building. Default is to build on the target. To build elsewhere, # change host ('localhost' for Ansible host) and perhaps path. diff --git a/tasks/main.yml b/tasks/main.yml index 0592086..5fee084 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -17,6 +17,15 @@ - {path: "{{ hedy_data_path }}", when: true} when: "item.when | bool" +- 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 }}" + - delegate_to: "{{ hedy_builder_host }}" when: "hedy_pull and hedy_container_image_self_build | bool" become: true