Skip to content

Commit a9858b0

Browse files
committed
Fix #1: Add a flush data option
1 parent c633580 commit a9858b0

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
### JetBrains
22
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio
3-
## Directory-based project format:
3+
*.iml
44
.idea/

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ Optional variables
1717

1818
(passed as extra variables):
1919

20-
- `loaddata`: A list of the dump files to load data from, eg `[project, auth]`, omit to skip loaddata.
20+
- `loaddata`: Set to `true` in order to load data from `conf.data`.
21+
- `flush`: Set to `true` in order to flush data before `loaddata`. Depends on `loaddata` variable to be `true`.
2122
- `newrelic`: New Relic license key. Omit to skip New Relic. Recommended to add a default in playbook.
2223

2324
Required Configuration variables
@@ -40,6 +41,7 @@ Optional Configuration variables
4041
- `conf.wsgi_script`: The wsgi script, default: `index.wsgi`.
4142
- `conf.compile_msgs`: Set to `true` in order to compile i18n messages.
4243
- `conf.memcached`: Set to `true` in order to clear cache.
44+
- `conf.data`: A list of the dump files to load data from, eg `[project, auth]`, omit to skip loaddata. Depends on `loaddata` variable to be `true`.
4345

4446
Other default variables
4547
-----------------------

tasks/main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@
6363
register: migrate_result
6464
changed_when: '"No migrations to apply." not in migrate_result.stdout'
6565

66+
- name: Flush data
67+
shell: "{{ manage }} flush --noinput {{ settings }}"
68+
when: loaddata is defined and loaddata == 'true' and flush is defined and flush == 'true'
69+
6670
- name: Load data
6771
shell: "{{ manage }} loaddata {{ item }} {{ settings }}"
6872
when: loaddata is defined and loaddata == 'true'

0 commit comments

Comments
 (0)