From 11d7a3fa6672876a70f01cde84d7455a181fbb72 Mon Sep 17 00:00:00 2001 From: L3D Date: Sat, 12 Nov 2022 16:25:43 +0100 Subject: [PATCH] runmigration --- tasks/configure.yml | 1 + tasks/download.yml | 1 + tasks/main.yml | 3 +++ tasks/migrate.yml | 7 +++++++ vars/main.yml | 2 +- 5 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 tasks/migrate.yml diff --git a/tasks/configure.yml b/tasks/configure.yml index 0d8a4c5..18e73c5 100644 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -7,6 +7,7 @@ mode: '0640' group: "{{ etebase__group }}" owner: "{{ etebase__user }}" + register: _etebase_config - name: "Create static data directorys" diff --git a/tasks/download.yml b/tasks/download.yml index 186ca17..d40e14c 100644 --- a/tasks/download.yml +++ b/tasks/download.yml @@ -11,6 +11,7 @@ umask: "0027" update: false version: "{{ etebase_version_target }}" + register: _etebase_download - name: Fix venv File owner/group become: true diff --git a/tasks/main.yml b/tasks/main.yml index 7168f36..2d0a9da 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -17,3 +17,6 @@ - name: Create Etebase Config ansible.builtin.include_tasks: configure.yml + +- name: Run ./manage.py migrate + ansible.builtin.include_tasks: migrate.yml diff --git a/tasks/migrate.yml b/tasks/migrate.yml new file mode 100644 index 0000000..2532b76 --- /dev/null +++ b/tasks/migrate.yml @@ -0,0 +1,7 @@ +--- +- name: Run python3 manage.py migrate + become: true + ansible.builtin.command: + chdir: "{{ etebase__user_home }}/etebase_{{ etebase_version_target }}" + cmd: "{{ etebase__venv }}/bin/python3 ./manage.py migrate" + changed_when: _etebase_download.changed or _etebase_config.changed diff --git a/vars/main.yml b/vars/main.yml index a1c523a..ccf9df5 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -3,5 +3,5 @@ etebase__repo: 'https://github.com/etesync/server.git' etebase__repo_api: 'https://api.github.com/repos/etesync/server/tags' # versionscheck -playbook_version_number: 04 # should be a integer +playbook_version_number: 5 # should be a integer playbook_version_path: 'role-etebase'