Skip to content

Commit 975dd54

Browse files
committed
Initial ansible modifications without vault
1 parent 288ec3c commit 975dd54

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

ansible/ansible-deploy.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
- hosts: runtime_host
33
vars_files:
44
- vars.yaml
5+
- vault.yaml
56
tasks:
67
- name: Copy and unarchive the package into the indicators runtime host directory.
78
unarchive:
@@ -18,9 +19,26 @@
1819
group: "{{ runtime_user }}"
1920
state: link
2021

22+
- name: Check to see if we have a params file to send.
23+
local_action: stat path="files/{{ indicator }}-params-prod.json"
24+
register: file
25+
26+
- name: Check to see if we have a params template to send.
27+
local_action: stat path="templates/{{ indicator }}-params-prod.json.j2"
28+
register: template
29+
2130
- name: Set production params file.
2231
copy:
2332
src: files/{{ indicator }}-params-prod.json
2433
dest: "{{ indicators_runtime_dir }}/{{ indicator }}/params.json"
2534
owner: "{{ runtime_user }}"
2635
group: "{{ runtime_user }}"
36+
when: file.stat.exists
37+
38+
- name: Set production params template.
39+
template:
40+
src: templates/{{ indicator }}-params-prod.json.j2
41+
dest: "{{ indicators_runtime_dir }}/{{ indicator }}/params.json"
42+
owner: "{{ runtime_user }}"
43+
group: "{{ runtime_user }}"
44+
when: template.stat.exists

ansible/files/jhu-params-prod.json renamed to ansible/templates/jhu-params-prod.json.j2

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,10 @@
33
"static_file_dir": "./static",
44
"export_dir": "/common/covidcast/receiving/jhu-csse/",
55
"cache_dir": "./cache",
6-
"base_url": "https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_{metric}_US.csv"
6+
"base_url": "https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_{metric}_US.csv",
7+
"aws_credentials": {
8+
"aws_access_key_id": "{{ delphi_aws_access_key_id }}",
9+
"aws_secret_access_key": "{{ delphi_aws_secret_access_key }}"
10+
},
11+
"bucket_name": "delphi-covidcast-indicator-output"
712
}

ansible/vars.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@ indicators_runtime_dir: "/home/{{ runtime_user }}/runtime"
55
package: "{{ indicator }}.tar.gz" # This is passed in the Ansible invocation.
66
python_version: "3.8.2"
77
pyenv_python_path: "/home/{{ runtime_user }}/.pyenv/versions/{{ python_version }}/bin/python"
8+
9+
# Indicators variables.
10+
delphi_aws_access_key_id: "{{ vault_delphi_aws_access_key_id }}"
11+
delphi_aws_secret_access_key: "{{ vault_delphi_aws_secret_access_key }}"

0 commit comments

Comments
 (0)