forked from EdgeVerve/cep-provision
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CEP_Install.yml
156 lines (121 loc) · 3.67 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
146
147
148
149
150
151
152
153
154
155
156
#©2016-2017 EdgeVerve Systems Limited (a fully owned Infosys subsidiary),Bangalore, India. All Rights Reserved.
#Get inputs from users to setup CEP
- hosts:
- all
- localhost
vars_prompt:
- name: DomainName
prompt: "Set Domain Name to access application/services(DNS should support *.domainname)"
default: "cepapp.dev"
private: no
- name: DirectLVMstorage
prompt: "Is lvm setup for docker storage required"
default: "no"
private: no
- name: Docker_storage_devs
prompt: "Disk path for docker storage setup (required if lvm setup is yes)"
default: "/dev/sdb"
private: no
- name: setupNFS
prompt: "Do you want setup NFS Server to persist CEP Component data"
default: "no"
private: no
- name: NFSSharePath
prompt: "Specify NFS Server share Folder (required if NFS Server setup is yes)"
private: no
- name: cepfolder
prompt: "Specify an folder for cep config and data files (eg: /datadisk)"
private: no
- name: cepUI
prompt: "Install CEP Portal - Portainer - yes/no"
default: "yes"
private: no
- name: cepmon
prompt: "Install Monitoring Service - Prometheus-Grafana - yes/no"
default: "yes"
private: no
- name: InstallGitlab
prompt: "Install Gitlab Service - yes/no"
default: "no"
private: no
- name: cepGraylog
prompt: "Install Logging Service - Graylog - yes/no"
default: "yes"
private: no
tasks:
- set_fact:
domainname: "{{DomainName}}"
cepfolder: "{{cepfolder}}"
installgitlab: "{{InstallGitlab}}"
installcepui: "{{cepUI}}"
directLVMstorage: "{{DirectLVMstorage}}"
docker_storage_devs: "{{Docker_storage_devs}}"
installgraylog: "{{cepGraylog}}"
installmonitor: "{{cepmon}}"
setupNFS: "{{setupNFS}}"
NFSSharePath: "{{NFSSharePath}}"
#Generate certificates
- hosts:
- localhost
roles:
- cert_generation
#Setup NFSServer if provided
- hosts:
- NFSServer
roles:
- { role: setup_NFS, when: setupNFS == True or setupNFS == "yes"}
#Install Docker engine in all machines
- hosts:
- AllHosts
roles:
- docker_storage
- certs
- install_docker
- app_config_setup
- { role: setup_cleanup_cron, when: cleanup_cron_enable == True or cleanup_cron_enable == "yes"}
- { role: cadvisor, when: installmonitor == True or installmonitor == "yes"}
#Determine swarm status for manager
- hosts:
- manager
roles:
- swarm_master_check
#Determine swarm status for worker
- hosts:
- worker
roles:
- swarm_worker_check
- hosts:
- localhost
roles:
- swarm_master_list
- swarm_worker_list
#Initiate swarm if not already present
- hosts:
- swarm_manager_bootstrap[0]
roles:
- swarm_master_init
#Retrieve swarm token
- hosts:
- swarm_manager_operational[0]
roles:
- swarm_retrieve_token
#Join swarm_masters
- hosts:
- swarm_manager_bootstrap:!swarm_manager_operational
roles:
- swarm_master_join
#Join swarm workers
- hosts:
- swarm_worker_bootstrap:!swarm_manager_bootstrap
roles:
- swarm_worker_join
#Create services
- hosts:
- swarm_manager_operational[0]
roles:
- router
- private_registry
- { role: cep_portal, when: installcepui == True or installcepui == "yes"}
- { role: gitlab, when: installgitlab == True or installgitlab == "yes"}
- { role: graylog, when: installgraylog == True or installgraylog == "yes"}
- { role: monitoring, when: installmonitor == True or installmonitor == "yes"}