-
Notifications
You must be signed in to change notification settings - Fork 3
/
lab_setup.yml
79 lines (68 loc) · 2.32 KB
/
lab_setup.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
---
# ACI fabric config must exist before we start deploying K8S, so I install acc provision on the ansible host.
# and I push the ACI config from there. After I will also install it on the kube-master
- hosts: 127.0.0.1
gather_facts: no
vars:
aci_login: &aci_login
hostname: "{{ aci_config.apic_hosts[0] }}"
username: '{{ aci_user }}'
password: '{{ aci_admin_pass }}'
use_proxy: 'no'
validate_certs: false
tasks:
- name: Install ACC Provision on the local host
apt:
deb: roles/aci-host/files/acc-provision_5.0.0.0-2-dev-jordan-eft_amd64.deb
delegate_to: localhost
become: true
- name: Create ACI Tenant for the Cluster
aci_tenant:
<<: *aci_login
name: "{{ aci_config.system_id }}"
delegate_to: localhost
- name: Create ACI VRF
aci_vrf:
<<: *aci_login
tenant: "{{ aci_config.vrf.tenant }}"
name: "{{ aci_config.vrf.tenant }}"
state: present
delegate_to: localhost
- name: Add L3OUT
aci_l3out:
<<: *aci_login
tenant: "{{ aci_config.vrf.tenant }}"
name: "{{ aci_config.l3out.name }}"
domain: " {{ aci_config.l3out.l3domain }}"
vrf: "{{ aci_config.vrf.name }}"
route_control: [ "export" ]
delegate_to: localhost
- name: Add extEPG
aci_l3out_extepg:
<<: *aci_login
tenant: "{{ aci_config.vrf.tenant }}"
l3out: "{{ aci_config.l3out.name }}"
name: "{{ item }}"
with_items: "{{ aci_config.l3out.external_networks }}"
delegate_to: localhost
- pause:
prompt: "Connect to APIC NOW and finish confiuring your L3OUT, you need to ADD your Nodes, routing protocol and the subnet in the ExtEPGs. Once done hit return"
- name: Generate CNI config and Push APIC Config
delegate_to: localhost
command: acc-provision --flavor="{{ k8s_flavor }}" -a -u "{{ aci_user }}" -p "{{ aci_admin_pass }}" -c inventory/group_vars/all.yml -o aci-cni-config.yaml
- hosts: vmware-vm
gather_facts: False
roles:
- vmware-vm
- hosts: k8s-cluster
gather_facts: True
roles:
- aci-host
- hosts: kube-master
gather_facts: True
roles:
- master
- hosts: kube-node
gather_facts: True
roles:
- node