-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathsetup_web_development.yml
52 lines (44 loc) · 1.82 KB
/
setup_web_development.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": "{{ app_name }}-db-{{ ansible_environment }}"
register: register_rds_info
- name: Obtain Elasticache Job host
community.aws.elasticache_info:
region: "{{ aws_region }}"
name: "{{ app_name }}-elasticache-{{ ansible_environment }}-job"
register: register_elasticache_job_info
- name: Obtain Elasticache Cache host
community.aws.elasticache_info:
region: "{{ aws_region }}"
name: "{{ app_name }}-elasticache-{{ ansible_environment }}-cache"
register: register_elasticache_cache_info
- set_fact:
rds_host: "{{ register_rds_info.instances[0].endpoint.address }}"
redis_job_host: "{{ register_elasticache_job_info.elasticache_clusters[0].cache_nodes[0].endpoint.address }}"
redis_cache_host: "{{ register_elasticache_cache_info.elasticache_clusters[0].cache_nodes[0].endpoint.address }}"
- hosts: _railway_ec2_development_webserver
remote_user: ansible
become: yes
roles:
- role: app_bootstrap
param_name: dev{{ group_id }}
param_env_vars: complete
param_group_id: "{{ group_id }}"
param_host: "https://dev{{ group_id }}.{{ app_host }}"
param_rds_host: "{{ hostvars['localhost']['rds_host'] }}"
param_redis_job_host: "{{ hostvars['localhost']['redis_job_host'] }}"
param_redis_cache_host: "{{ hostvars['localhost']['redis_cache_host'] }}"
tags: app_bootstrap
- role: app_database_create
param_name: dev{{ group_id }}
tags: app_database_create
- role: app_application_server
param_name: dev{{ group_id }}
param_port: 300{{ group_id }}
tags: app_application_server