-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathset_api_keys.yml
36 lines (28 loc) · 1.04 KB
/
set_api_keys.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
---
- name: Set various API keys
hosts: all
become: yes
gather_facts: yes
tasks:
- name: load keys from var file
include_vars:
file: "{{ apikeys | default('vars/api_keys.yml') }}"
- block:
- name: rake app:set_api_keys
shell: WORLDCAT_API_KEY="{{ worldcat_api_key | default('worldcat_api_key_not_set') }}" ALMA_API_KEY="{{ alma_api_key | default('alma_api_key_not_set') }}" PRIMO_API_KEY="{{ primo_api_key | default('primo_api_key_not_set') }}" RAILS_ENV={{ rails_env | default('development') }} /home/{{ app }}/.rbenv/shims/bundle exec rake app:set_alma_api_key
args:
chdir: /home/{{ app }}/{{ app }}
register: rake_app_set_api_keys
notify: restart papyrus
- name: create /home/{{ app }}/{{ app }}/config/api_keys.yml
template:
src: templates/api_keys.yml
dest: "/home/{{ app }}/{{ app }}/config/api_keys.yml"
become: yes
become_user: "{{ app }}"
handlers:
- name: restart papyrus
systemd:
state: restarted
name: papyrus
enabled: yes