-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy-pdf-signer.yaml
53 lines (49 loc) · 1.46 KB
/
deploy-pdf-signer.yaml
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
---
- hosts: pdf_signer
tasks:
- name: "Ensure Docsigner User Exists"
assert:
that: "'docsigner_user' in hostvars"
msg: "docsigner_user not found, have you created the AWS infrastructure?"
- name: "pdf-signer dependencies"
pip:
name:
- boto3
- iso8601
- name: "Copy pdf-signer"
synchronize:
mode: push
src: "pdf-signer/"
dest: "{{ ansible_user_dir }}/pdf-signer"
perms: true
recursive: true
delete: true
use_ssh_args: true
notify: queue_reader_changed
- import_role:
name: aws_services_ini
vars:
dest_dir: "{{ ansible_user_dir }}"
iam_user: docsigner_user
queues:
transaction_queue: transaction_signing_queue
buckets:
pdf_bucket: pdf_store_bucket
topics:
signing_events_topic: signing_events_topic
- name: "Activate Queue Reader Cron"
cron:
name: queue-reader.py
state: present
minute: "*"
job: sh -c "pgrep queue-reader.py > /dev/null ||
PYTHONUNBUFFERED=true
{{ ansible_user_dir }}/pdf-signer/queue-reader.py '{{ ansible_user_dir }}/aws_services.ini' > log.txt 2>&1"
notify: queue_reader_changed
handlers:
- name: "Stop Queue Reader"
command: pkill queue-reader.py
register: result
failed_when: false
changed_when: "result.rc == 0"
listen: queue_reader_changed