This repository has been archived by the owner. It is now read-only.
Permalink
Cannot retrieve contributors at this time
29 lines (24 sloc)
724 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 }}" | |