-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure-server.yml
37 lines (32 loc) · 1.25 KB
/
configure-server.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
---
- name: "configuration play."
hosts: web
user: ubuntu
become: true
become_method: sudo
become_user: root
gather_facts: false
vars:
- ansible_python_interpreter: /usr/bin/python3
- ansible_host_key_checking: false
- ansible_stdout_callback: yaml
pre_tasks:
- name: "wait 600 seconds for target connection to become reachable/usable."
wait_for_connection:
- name: "install python for Ansible."
become: true
raw: test -e /usr/bin/python3 || (apt -y update && apt install -y python3)
changed_when: false
# Get the environment variables from CircleCI and add to the EC2 instance
environment:
- TYPEORM_CONNECTION: "{{ lookup('env', 'TYPEORM_CONNECTION')}}"
- TYPEORM_ENTITIES: "{{ lookup('env', 'TYPEORM_ENTITIES')}}"
- TYPEORM_HOST: "{{ lookup('env', 'TYPEORM_HOST')}}"
- TYPEORM_PORT: "{{ lookup('env', 'TYPEORM_PORT')}}"
- TYPEORM_USERNAME: "{{ lookup('env', 'TYPEORM_USERNAME')}}"
- TYPEORM_PASSWORD: "{{ lookup('env', 'TYPEORM_PASSWORD')}}"
- TYPEORM_DATABASE: "{{ lookup('env', 'TYPEORM_DATABASE')}}"
- TYPEORM_MIGRATIONS: "{{ lookup('env', 'TYPEORM_MIGRATIONS')}}"
- TYPEORM_MIGRATIONS_DIR: "{{ lookup('env', 'TYPEORM_MIGRATIONS_DIR')}}"
roles:
- configure-server