forked from EdgeVerve/cep-provision
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CEP_Install.yml
145 lines (127 loc) · 3.78 KB
/
CEP_Install.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#©2016-2017 EdgeVerve Systems Limited (a fully owned Infosys subsidiary),Bangalore, India. All Rights Reserved.
#Get inputs from users to setup CEP
- hosts:
- localhost
tags:
- variable_setup
roles:
- variable_setup
#Include variable
- hosts:
- all
tags:
- variable_setup
tasks:
- name: Include variables
include_vars: group_vars/all
#Checking for pre-requisites
- hosts:
- AllHosts
tags:
- pre_check
roles:
- pre_check
#Generate certificates
- hosts:
- localhost
tags:
- cert_gen
roles:
- cert_generation
#Setup NFSServer if provided
- hosts:
- NFSServer
tags:
- nfs_server_setup
roles:
- { role: setup_NFS, when: setupNFS == True or setupNFS == "yes"}
#Install Docker engine in all machines
- hosts:
- AllHosts
roles:
- { role: docker_storage, tags: [ 'docker_storage' ] }
- { role: certs, tags: [ 'cert_setup' ] }
- { role: install_docker, tags: [ 'install_docker' ] }
- app_config_setup
- { role: setup_cleanup_cron, tags: [ 'setup_cleanup_cron' ] , when: cleanup_cron_enable == True or cleanup_cron_enable == "yes"}
- { role: cadvisor, tags: [ 'cadvisor','monitoring' ] ,when: installmonitor == True or installmonitor == "yes"}
#Determine swarm status for manager
- hosts:
- manager
tags:
- swarm_setup
- router
- private_registry
- cep_portal
- gitlab
- graylog
- monitoring
- auto-scaling
- ucp_setup
- dtr_setup
roles:
- swarm_master_check
#Determine swarm status for worker
- hosts:
- worker
tags:
- swarm_setup
roles:
- swarm_worker_check
- hosts:
- localhost
roles:
- { role: swarm_master_list, tags: ['swarm_setup','router','private_registry','cep_portal','gitlab','graylog','monitoring','auto-scaling','ucp_setup','dtr_setup'] }
- { role: swarm_worker_list, tags: ['swarm_setup'] }
#Initiate swarm if not already present
- hosts:
- swarm_manager_bootstrap[0]
tags:
- swarm_setup
roles:
- { role: swarm_master_init, tags: [ 'swarm_setup' ] , when: "(docker_ee_subscription == '' and swarm_manager_operational_list.0 == '[' )" }
- { role: ucp_setup, tags: [ 'ucp_setup' ] , when: "(docker_ee_subscription != '' and swarm_manager_operational_list.0 == '[' )" }
#Retrieve swarm token
- hosts:
- swarm_manager_operational[0]
tags:
- swarm_setup
roles:
- swarm_retrieve_token
#Join swarm_masters
- hosts:
- swarm_manager_bootstrap:!swarm_manager_operational
tags:
- swarm_setup
roles:
- swarm_master_join
#Join swarm workers
- hosts:
- swarm_worker_bootstrap:!swarm_manager_bootstrap
tags:
- swarm_setup
roles:
- swarm_worker_join
#Create services
- hosts:
- swarm_manager_operational[0]
roles:
#- { role: ucp_setup, tags: [ 'ucp_setup' ] , when: docker_ee_subscription != ""}
- { role: router, tags: [ 'router' ]}
- { role: dtr_setup, tags: [ 'dtr_setup' ] , when: docker_ee_subscription != ""}
#Create DTR replica
- hosts:
- AllHosts:!swarm_manager_operational[0]
serial: 1
roles:
- { role: dtr_replica_setup, tags: [ 'dtr_setup' ] , when: docker_ee_subscription != ""}
#Create services
- hosts:
- swarm_manager_operational[0]
roles:
- { role: private_registry, tags: [ 'private_registry' ] }
- { role: cep_portal, tags: [ 'cep_portal' ] , when: installcepui == True or installcepui == "yes"}
- { role: gitlab, tags: [ 'gitlab' ] , when: installgitlab == True or installgitlab == "yes"}
- { role: graylog, tags: [ 'graylog' ] , when: installgraylog == True or installgraylog == "yes"}
- { role: monitoring, tags: [ 'monitoring' ] , when: installmonitor == True or installmonitor == "yes"}
- { role: auto-scaling, tags: [ 'auto-scaling' ] , when: installAutoScale == True or installAutoScale == "yes"}