-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathopenstack-launch-application-stack.yml
83 lines (77 loc) · 2.44 KB
/
openstack-launch-application-stack.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
---
- name: Launch OpenStack instance(s)
hosts: all
connection: local
gather_facts: no
roles:
- opsta.openstack_launch_instances
environment: "{{ proxy_env | default({}) }}"
- name: Install python2
hosts: launched_openstack_instances
gather_facts: no
become: true
tasks:
- name: Configure apt-cacher-ng
raw: "echo 'Acquire::http::Proxy \"{{ host_preparation_apt_cacher_ng }}\";' >
/etc/apt/apt.conf.d/11proxy"
when: host_preparation_apt_cacher_ng is defined
- name: Install Python 2
raw: "python --version || apt update && apt install -y python"
environment: "{{ proxy_env | default({}) }}"
- name: Configure instance(s)
hosts: launched_openstack_instances
gather_facts: yes
become: true
roles:
- role: opsta.host_preparation
- role: opsta.install_docker
- role: opsta.newrelic
when: newrelic_license_key is defined
environment: "{{ proxy_env | default({}) }}"
- name: Configure Docker Machine
hosts: launched_openstack_instances
connection: local
gather_facts: yes
become: false
roles:
- role: opsta.docker_machine
docker_machine_create: true
docker_machine_manage_config: true
when: |
automated_docker_name is defined or
automated_docker_sensu_client_rabbitmq_host is defined
environment: "{{ proxy_env | default({}) }}"
- name: Deploy service
hosts: launched_openstack_instances
connection: local
# NOTE Still need gather_facts = yes because of work around on Docker for Mac
# and Xenial work around on Sensu Client
gather_facts: yes
serial: 1
roles:
- role: opsta.automated_docker
when: automated_docker_name is defined
environment: "{{ proxy_env | default({}) }}"
- name: Deploy Keepalived
hosts: launched_openstack_instances
gather_facts: yes
become: true
roles:
- role: opsta.keepalived
when: |
automated_docker_name is defined and
automated_docker_name == 'haproxy' and
os_instance.count > 1
environment: "{{ proxy_env | default({}) }}"
- name: Deploy Sensu Client
hosts: launched_openstack_instances
connection: local
# NOTE Still need gather_facts = yes because of work around on Docker for Mac
# and Xenial work around on Sensu Client
gather_facts: yes
serial: 1
roles:
- role: opsta.automated_docker
automated_docker_name: sensu_client
when: automated_docker_sensu_client_rabbitmq_host is defined
environment: "{{ proxy_env | default({}) }}"