-
Notifications
You must be signed in to change notification settings - Fork 9
/
database_restore.yml
52 lines (44 loc) · 1.44 KB
/
database_restore.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
---
- hosts: localhost
gather_facts: False
tasks:
- name: Obtain RDS host
community.aws.rds_instance_info:
region: "{{ aws_region }}"
filters:
"db-instance-id": festalab-db-{{ ansible_environment }}
register: register_rds_info
- set_fact:
rds_host: "{{ register_rds_info.instances[0].endpoint.address }}"
- hosts: _railway_ec2_development_worker
gather_facts: False
remote_user: ansible
become: yes
roles:
- role: app_database_create
param_name: dev{{ group_id }}
tags: app_database_create
- role: aws_rds_restore
param_name: "dev{{ group_id }}"
param_rds_host: "{{ hostvars['localhost']['rds_host'] }}"
param_rds_username: "{{ aws_rds_username }}"
param_rds_password: "{{ aws_rds_password }}"
param_rds_database: "{{ aws_rds_database }}{{ group_id }}"
param_dump_type: "{{ dump_type | default('truncated') }}"
tags: aws_rds_restore
- role: app_deploy_migrate
param_name: "dev{{ group_id }}"
tags: app_deploy_migrate
- role: app_worker_server_restart
param_name: "dev{{ group_id }}"
tags: app_worker_server_restart
post_tasks:
- name: Clear the caches
shell: ~/.rbenv/shims/bundle exec rake festalab:development:clear_caches
args:
chdir: ~app/dev{{ group_id }}
become: yes
become_user: app
ignore_errors: yes
changed_when: false
register: check_database