-
Notifications
You must be signed in to change notification settings - Fork 3
/
full_deploy.yml
35 lines (31 loc) · 1.56 KB
/
full_deploy.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
---
# This playbook deploys the infrastrcture and the Spring app
- name: Launch needed EC2 instances and services
hosts: local
connection: local
roles:
- { role: aws_ec2_key, tags: ['aws_set_key'], when: create_ec2_instances } # Populate or create they key to be assigned to our instances
- { role: aws_ec2_instances, tags: ['create_ec2_services'], when: create_ec2_instances } # At minimum, create two instances in two different 'available' Availablity-Zones
- { role: aws_route53, tags: ['create_route53_records'] }
- name: Pre-play install Python with raw command
vars:
aws_profile: "{{ lookup('env', 'AWS_DEFAULT_PROFILE') | default('test', true) }}" #shamelessly hacking hosts as a variable
hosts:
- "{{ aws_profile }}"
gather_facts: no
become: yes
roles:
- { role: minimal_python, tags: ['minimal_python'] }
- name: Deploy the Spring App
vars:
aws_profile: "{{ lookup('env', 'AWS_DEFAULT_PROFILE') | default('test', true) }}"
hosts:
- "{{ aws_profile }}"
become: yes
gather_facts: yes
roles:
- { role: common, tags: ['common'] } # java and maven are also installed here
- { role: haproxy, tags: ['haproxy'] } # haproxy installation and configuration, load balancing between spring apps
- { role: rsyslog, tags: ['rsyslog'] } # rsyslog configuration, enable for haproxy
- { role: nginx, tags: ['nginx'] } # nginx installation and configuration, proxying to haproxy from elb.
- { role: deploy_spring_app, tags: ['deploy_spring_app'] } # this is a collection of tasks to clone/checkout/package/run an app