From f7fb7bcd346317d45bac3771f6a63c691b589fa4 Mon Sep 17 00:00:00 2001 From: Julian Foad Date: Fri, 5 Jan 2024 14:29:57 +0000 Subject: [PATCH] fix empty db creation on new installation --- defaults/main.yml | 2 +- tasks/main.yml | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) 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