forked from DemocracyClub/polling_deploy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimport_data.yml
37 lines (30 loc) · 1.12 KB
/
import_data.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
---
- hosts: servers
vars_files:
- vars.yml
# We want the vault to be loaded conditionally, so we do if via the
# `--extra-args` command line flag
# - @vault.yml
gather_facts: true
become: true
become_user: "{{ project_name }}"
tasks:
- name: Import Councils
shell: "{{ project_root }}/env/bin/python {{ project_root }}/code/manage.py import_councils -u {{ alt_boundaries_url }}"
args:
chdir: "{{ project_root }}/code/"
- name: Create private_data_path
file: state=directory path={{ private_data_path }}
- name: Sync S3 bucket
shell: "aws s3 sync s3://pollingstations-data/ {{ private_data_path }}"
- name: Apply Misc Fixes
shell: "{{ project_root }}/env/bin/python {{ project_root }}/code/manage.py misc_fixes"
args:
chdir: "{{ project_root }}/code/"
- name: Import data
shell: "{{ project_root }}/env/bin/python {{ project_root }}/code/manage.py import -e '{{ election_regex }}' -r --multiprocessing"
args:
executable: /bin/bash
chdir: "{{ project_root }}"
- name: Delete private_data_path
file: state=absent path={{ private_data_path }}