Commit 7ad11c28 authored by Antonis Kalou's avatar Antonis Kalou

Run database migrations on deploy

parent fd9e7132
......@@ -65,7 +65,11 @@
remote_src: no
become: yes
# FIXME: make sure file is templated with vault env vars
# TODO: only execute when systemd service is created
- name: reload systemd daemon
systemd: daemon_reload=yes
become: yes
- name: export environment variables for service
template:
src: "../files/moodle_net.service.d/override.conf.j2"
......@@ -74,12 +78,23 @@
remote_src: no
become: yes
- name: start moodle net service
- name: stop moodle net service
systemd:
name: moodle_net
state: stopped
become: yes
- name: run database migrations
command: "/opt/moodle_net/bin/moodle_net eval 'MoodleNet.ReleaseTasks.migrate_db()'"
environment: "{{ export }}"
become: yes
become_user: moodle
- name: start and enable moodle net service
systemd:
name: moodle_net
state: started
enabled: yes
daemon_reload: yes
become: yes
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment