Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
aca8f06a7b
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
29 lines (24 sloc) 724 Bytes
# Restore sharable database tables from a local json file onto to server.
#
# See also:
# dumpdb.yml
#
# Playbook command:
# ansible-playbook -i inventory restoredb.yml
- hosts: cloudlaunch-webserver
gather_facts: no
become: yes
vars:
app_dir: /opt/cloudlaunch-server/django-cloudlaunch
dump_file: /tmp/clouds_and_apps.json
venv: /opt/cloudlaunch-server/.venv
tasks:
- name: Transfer the dump file to remote server
copy:
src: "./cloudlaunch_clouds_and_apps.json"
dest: "{{ dump_file }}"
- name: Restore database data
become_user: cloudlaunch
command: "{{ venv }}/bin/python manage.py loaddata {{ dump_file }}"
args:
chdir: "{{ app_dir }}"