This repository has been archived by the owner on Aug 19, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
start_esx.yml
67 lines (63 loc) · 2.62 KB
/
start_esx.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
---
# #####################################################################
# Create MOADSD-NG Environment in VMWare ESXi (k8s only)
# #####################################################################
- name: Include site credentials
include_vars: vars/site_secrets.yml
- name: Include vars for ESX
include_vars: "{{ item }}"
with_items:
- vars/environment_esx_secrets.yml
- vars/environment_esx_vars.yml
when: type == 'esx'
- name: Report
uri:
url: "{{ report_url }}"
method: POST
headers:
x-api-key: "{{ report_key | b64decode }}"
validate_certs: yes
body_format: json
body: |
{
"TableName": "moadsd-ng-reporter",
"Item": {
"datetime": {"S": "{{ lookup('pipe','date +%Y-%m-%d-%H-%M-%S') }}" },
"admin_email": {"S": "{{ admin_email | hash('sha256') }}" },
"type": {"S": "{{ type }}" },
"action": {"S": "{{ run_pb }}" },
"site_deploy_kubernetes": {"S": "{{ site_deploy_kubernetes }}" },
"site_deploy_openshift": {"S": "{{ site_deploy_openshift }}" },
"site_deploy_deepsecurity": {"S": "{{ site_deploy_deepsecurity }}" },
"site_deploy_smartcheck": {"S": "{{ site_deploy_smartcheck }}" },
"site_deploy_jenkins": {"S": "{{ site_deploy_jenkins }}" },
"site_deploy_gitlab": {"S": "{{ site_deploy_gitlab }}" },
"site_deploy_endpoints": {"S": "{{ site_deploy_endpoints }}" },
"site_deploy_linkerd": {"S": "{{ site_deploy_linkerd }}" },
"site_deploy_prometheus": {"S": "{{ site_deploy_prometheus }}" },
"site_deploy_grafana": {"S": "{{ site_deploy_grafana }}" },
"site_deploy_opa": {"S": "{{ site_deploy_opa }}" },
"site_deploy_jumphost": {"S": "{{ site_deploy_jumphost }}" }
}
}
status_code: 200
delegate_to: localhost
- name: Create instance for Kubernetes master
include_role:
name: environment-esx
vars:
operation: create_linux_instance
instance_name: "{{ kubernetes_master_instance_name }}"
instance_login_user: "{{ kubernetes_master_login_user }}"
instance_login_password: "{{ kubernetes_master_login_password }}"
when: site_deploy_kubernetes == True
- name: Create instance for Kubernetes worker
include_role:
name: environment-esx
vars:
operation: create_linux_instance
instance_name: "{{ kubernetes_worker_instance_name }}{{ item }}"
instance_login_user: "{{ kubernetes_worker_login_user }}"
instance_login_password: "{{ kubernetes_worker_login_password }}"
with_sequence: count="{{ kubernetes_worker_count }}"
when: site_deploy_kubernetes == True