-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.yaml
43 lines (39 loc) · 959 Bytes
/
main.yaml
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
- hosts: localhost
gather_facts: False
tasks:
- name: "Initializing terraform providers"
shell:
cmd: terraform init
chdir: ./terraform
- name: "Provisioning 1 AWS Instance , 1 Azure VM"
community.general.terraform:
project_path: ./terraform
state: present
- meta: refresh_inventory
- hosts: all
gather_facts: False
tasks:
- name: "Waiting for SSH port"
wait_for_connection:
- hosts: master_node
gather_facts: False
roles:
- configure-master
tasks:
- name: "Getting token from master"
shell: "kubeadm token create --print-join-command"
register: token
- add_host:
name: "token_for_worker"
link: "{{ token['stdout'] }}"
- hosts: slave_nodes
gather_facts: False
roles:
- configure-slave
tasks:
- name: "Worker Nodes joining the cluster"
shell: "{{ hostvars['token_for_worker']['link'] }}"
- hosts: master_node
gather_facts: False
roles:
- wordpress-mysql