Skip to content

Commit

Permalink
Bump alb support to 22.x (#13)
Browse files Browse the repository at this point in the history
* refactor for alb 22.x
mermaid fixes

* bump docker image to include alb API update

---------

Co-authored-by: Matt Proud <[email protected]>
  • Loading branch information
laidbackware and Matt Proud authored Sep 26, 2023
1 parent dd2c62e commit 2cf8eff
Show file tree
Hide file tree
Showing 18 changed files with 32 additions and 27 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ alias lab-builder="docker run --rm \
--env AVI_DEFAULT_PASSWORD=\"${AVI_DEFAULT_PASSWORD:-na}\" \
--volume ${SOFTWARE_DIR}:/software_dir \
--volume ${PWD}:/work \
laidbackware/vmware-lab-builder:v8 \
laidbackware/vmware-lab-builder:v9 \
ansible-playbook"
# This command is run inside the container, so point to the `/work` directory within the container.
Expand Down Expand Up @@ -105,7 +105,7 @@ docker run -it --rm \
--env AVI_DEFAULT_PASSWORD=${AVI_DEFAULT_PASSWORD:-na} \
--volume ${SOFTWARE_DIR}:/software_dir \
--volume ${PWD}:/work \
laidbackware/vmware-lab-builder:v8 \
laidbackware/vmware-lab-builder:v9 \
/bin/bash
# Then the playbook can be triggered
Expand All @@ -126,7 +126,7 @@ For solution specific features, check the relevant example directory.
## Docker Image Build
From the root of the repo. Note no-cache flag used to force builds to pickup any changes to the git repos.
```
docker build --no-cache ./docker/. -t laidbackware/vmware-lab-builder:v8
docker build --no-cache ./docker/. -t laidbackware/vmware-lab-builder:v9
```

## Local Usage
Expand All @@ -140,7 +140,7 @@ Software dependencies for Linux:
- Add necessary Ansible collections. Force switch will ensure it is upgraded.
```
ansible-galaxy collection install community.vmware:3.0.0 --force
ansible-galaxy collection install vmware.alb:21.1.5 --force
ansible-galaxy collection install vmware.alb:22.1.4 --force
ansible-galaxy collection install git+https://github.com/vmware/ansible-for-nsxt.git,v3.2.0 --force
ansible-galaxy collection install git+https://github.com/laidbackware/ansible-for-vsphere-tanzu.git,ansible-galaxy --force
```
4 changes: 2 additions & 2 deletions deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
tags: ["vsphere"]
- role: vsphere/vsphere-import-vm-template
when: 'vm_templates is defined'
tags: ["vsphere"]
tags: ["vsphere", "vm-template"]

# NSX-T Section
- role: nsxt/nsxt-mgmt-appliance
Expand Down Expand Up @@ -97,7 +97,7 @@
tags: ["nsx-alb"]
- role: nsx-alb/configure-cloud
when: 'nsx_alb is defined'
tags: ["nsx-alb"]
tags: ["nsx-alb", "alb-cloud"]
- role: nsx-alb/dummy-service
when: 'nsx_alb.dummy_service is defined'
tags: ["nsx-alb"]
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ RUN set -xe \
&& ansible-galaxy collection install community.vmware:3.0.0 \
\
&& echo "****** Adding vmware.avi from Ansible Galaxy ******" \
&& ansible-galaxy collection install vmware.alb:21.1.5 \
&& ansible-galaxy collection install vmware.alb:22.1.4 \
\
&& echo "****** Adding ansible-for-nsxt from Github ******" \
&& ansible-galaxy collection install git+https://github.com/vmware/ansible-for-nsxt.git,v3.2.0 \
Expand Down
6 changes: 4 additions & 2 deletions roles/nsx-alb/configure-cloud/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- name: Create a VMWare cloud with write access mode
vmware.alb.avi_cloud:
avi_credentials: "{{ avi_credentials }}"
apic_mode: false
# apic_mode: false
dhcp_enabled: true
enable_vip_static_routes: false
name: Default-Cloud
Expand All @@ -15,6 +15,7 @@
privilege: WRITE_ACCESS
username: "{{ cloud_vcenter_username }}"
vcenter_url: "{{ cloud_vcenter_url }}"
use_content_lib: false
vtype: CLOUD_VCENTER
register: cloud_config

Expand Down Expand Up @@ -132,7 +133,7 @@
- name: Update Default cloud with IPAM/DNS profiles
vmware.alb.avi_cloud:
avi_credentials: "{{ avi_credentials }}"
apic_mode: false
# apic_mode: false
dhcp_enabled: false
enable_vip_static_routes: false
ipam_provider_ref: /api/ipamdnsproviderprofile/?name=tkg-ipam-profile
Expand All @@ -150,6 +151,7 @@
addr: "{{ se_management_network_cidr.split('/')[0] }}"
type: V4
mask: "{{ se_management_network_cidr.split('/')[1] }}"
use_content_lib: false
vtype: CLOUD_VCENTER
register: cloud_config

Expand Down
1 change: 1 addition & 0 deletions roles/nsx-alb/configure-cloud/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ controller_ip: "{{ nsx_alb.controller_ip }}"
controller_username: "{{ nsx_alb.controller_username }}"
controller_password: "{{ nsx_alb.controller_password }}"
api_version: "{{ nsx_alb.api_version }}"
# api_version: 22.1.3

avi_credentials:
controller: "{{ controller_ip }}"
Expand Down
2 changes: 1 addition & 1 deletion roles/vsphere/vsphere-import-vm-template/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- name: Deploy OVA that will be imported as a template
- name: Upload OVA that will be converted into a template
community.vmware.vmware_deploy_ovf:
hostname: "{{ item.0.vcenter_server }}"
username: "{{ item.0.vcenter_username }}"
Expand Down
2 changes: 1 addition & 1 deletion var-examples/base-vsphere/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ flowchart LR
router_net("Routed\nNetwork")
esxi_host["Physical\nESXi Host"]
base_pg("Base\nPort Group")
nested_host["Nested\nHost"]
nested_host["Nested\nESXi Host"]
vcenter["vCenter"]
base_vss("VM network\nStandard Switch")
Expand Down
2 changes: 1 addition & 1 deletion var-examples/nsxt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ flowchart LR
esxi_host["Physical\nESXi Host"]
base_pg("Base Port Group\n(Routed)")
tep_pg("TEP Port Group\n(Private)")
nested_host["Nested\nHost"]
nested_host["Nested\nESXi Host"]
vcenter["vCenter"]
nsx_mgr[NSX Manager]
base_vss("VM network\nStandard Switch")
Expand Down
2 changes: 1 addition & 1 deletion var-examples/tanzu/application-service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ flowchart LR
esxi_host["Physical\nESXi Host"]
base_pg("Base Port Group\n(Routed)")
tep_pg("TEP Port Group\n(Private)")
nested_host["Nested\nHost"]
nested_host["Nested\nESXi Host"]
vcenter["vCenter"]
nsx_mgr[NSX Manager]
base_vss("VM network\nStandard Switch")
Expand Down
2 changes: 1 addition & 1 deletion var-examples/tanzu/integrated-nsxt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ flowchart LR
esxi_host["Physical\nESXi Host"]
base_pg("Base Port Group\n(Routed)")
tep_pg("TEP Port Group\n(Private)")
nested_host["Nested\nHost"]
nested_host["Nested\nESXi Host"]
vcenter["vCenter"]
nsx_mgr[NSX Manager]
base_vss("VM network\nStandard Switch")
Expand Down
2 changes: 1 addition & 1 deletion var-examples/tanzu/multi-cloud/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ flowchart LR
esxi_host["Physical\nESXi Host"]
base_pg("Base\nPort Group")
trunk_pg("Trunk\nPort Group")
nested_host["Nested\nHost"]
nested_host["Nested\nESXi Host"]
vcenter["vCenter"]
nsx_alb_cont["NSX-ALB\nControllers"]
base_vss("VM network\nStandard Switch")
Expand Down
4 changes: 2 additions & 2 deletions var-examples/tanzu/multi-cloud/opinionated-1host.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# SOFTWARE_DIR must contain all required software
vc_iso: "{{ lookup('env', 'SOFTWARE_DIR') }}/VMware-VCSA-all-8.0.1-21860503.iso"
esxi_ova: "{{ lookup('env', 'SOFTWARE_DIR') }}/Nested_ESXi8.0u1a_Appliance_Template_v1.ova"
nsx_alb_controller_ova: "{{ lookup('env', 'SOFTWARE_DIR') }}/controller-21.1.4-9210.ova"
tkgm_os_kubernetes_ova: "{{ lookup('env', 'SOFTWARE_DIR') }}/ubuntu-2004-kube-v1.25.7+vmware.2-tkg.1-8a74b9f12e488c54605b3537acb683bc.ova"
nsx_alb_controller_ova: "{{ lookup('env', 'SOFTWARE_DIR') }}/controller-21.1.5-9172.ova"
tkgm_os_kubernetes_ova: "{{ lookup('env', 'SOFTWARE_DIR') }}/ubuntu-2004-kube-v1.26.5+vmware.2-tkg.1-814430d158ce7889d5a7b60efeda67ca.ova"

environment_tag: "tanzu-multi-cloud-avi" # Used to prepend object names in hosting vCenter
dns_server: "192.168.0.1"
Expand Down
2 changes: 1 addition & 1 deletion var-examples/tanzu/vsphere-nsxt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ flowchart LR
esxi_host["Physical\nESXi Host"]
base_pg("Base Port Group\n(Routed)")
tep_pg("TEP Port Group\n(Private)")
nested_host["Nested\nHost"]
nested_host["Nested\nESXi Host"]
vcenter["vCenter"]
nsx_mgr[NSX Manager]
base_vss("VM network\nStandard Switch")
Expand Down
2 changes: 2 additions & 0 deletions var-examples/tanzu/vsphere-nsxt/opinionated-1host.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
---
# SOFTWARE_DIR must contain all required software
vc_iso: "{{ lookup('env', 'SOFTWARE_DIR') }}/VMware-VCSA-all-8.0.1-21860503.iso"
# vc_iso: "{{ lookup('env', 'SOFTWARE_DIR') }}/VMware-VCSA-all-7.0.3-21958406.iso"
esxi_ova: "{{ lookup('env', 'SOFTWARE_DIR') }}/Nested_ESXi8.0u1a_Appliance_Template_v1.ova"
# esxi_ova: "{{ lookup('env', 'SOFTWARE_DIR') }}/Nested_ESXi7.0u3m_Appliance_Template_v1.ova"
nsxt_ova: "{{ lookup('env', 'SOFTWARE_DIR') }}/nsx-unified-appliance-4.0.1.1.0.20598732.ova"

environment_tag: "tanzu-vsphere-nsxt" # Used to prepend object names in hosting vCenter
Expand Down
2 changes: 1 addition & 1 deletion var-examples/tanzu/vsphere-vds-alb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ flowchart LR
esxi_host["Physical\nESXi Host"]
base_pg("Base\nPort Group")
trunk_pg("Trunk\nPort Group")
nested_host["Nested\nHost"]
nested_host["Nested\nESXi Host"]
vcenter["vCenter"]
nsx_alb_cont[NSX-ALB Controllers]
base_vss("VM network\nStandard Switch")
Expand Down
10 changes: 5 additions & 5 deletions var-examples/tanzu/vsphere-vds-alb/opinionated-1host.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
# SOFTWARE_DIR must contain all required software
vc_iso: "{{ lookup('env', 'SOFTWARE_DIR') }}/VMware-VCSA-all-8.0.1-21860503.iso"
esxi_ova: "{{ lookup('env', 'SOFTWARE_DIR') }}/Nested_ESXi8.0u1a_Appliance_Template_v1.ova"
nsx_alb_controller_ova: "{{ lookup('env', 'SOFTWARE_DIR') }}/controller-21.1.5-9172.ova"
vc_iso: "{{ lookup('env', 'SOFTWARE_DIR') }}/VMware-VCSA-all-8.0.2-22385739.iso"
esxi_ova: "{{ lookup('env', 'SOFTWARE_DIR') }}/Nested_ESXi8.0u2_Appliance_Template_v1.ova"
nsx_alb_controller_ova: "{{ lookup('env', 'SOFTWARE_DIR') }}/controller-22.1.3-9096.ova"

environment_tag: "tanzu-vsphere-vds-avi" # Used to prepend object names in hosting vCenter
dns_server: "192.168.0.1"
Expand Down Expand Up @@ -173,10 +173,10 @@ tanzu_vsphere:
- starting_ip: "{{ opinionated.hosting_network.workload.cidr | ansible.utils.ipmath(2) }}"
num_of_ips: >-
{{ opinionated.hosting_network.workload.cidr |
ansible.utils.ipsubnet((opinionated.hosting_network.workload.cidr.split('/')[1] |int)+1, 1) | ipsubnet(32) |int -2 }}
ansible.utils.ipsubnet((opinionated.hosting_network.workload.cidr.split('/')[1] |int)+1, 1) | ansible.utils.ipsubnet(32) |int -2 }}
nsx_alb:
api_version: "20.1.7"
api_version: "{{ nsx_alb_controller_ova | regex_search('(?<=controller-).*?(?=-)') }}"
controller_username: admin
controller_password: "{{ opinionated.master_password }}"
controller_ssh_public_key: "{{ opinionated.ssh_public_key }}"
Expand Down
2 changes: 1 addition & 1 deletion var-examples/tanzu/vsphere-vds-haproxy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ flowchart LR
esxi_host["Physical\nESXi Host"]
base_pg("Base\nPort Group")
trunk_pg("Trunk\nPort Group")
nested_host["Nested\nHost"]
nested_host["Nested\nESXi Host"]
vcenter["vCenter"]
base_vss("VM network\nStandard Switch")
trunk_vds("Trunk\nDistributed Switch")
Expand Down
4 changes: 2 additions & 2 deletions var-examples/tanzu/vsphere-vds-haproxy/opinionated-1host.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,15 @@ tanzu_vsphere:
# formula to split the workload subnet in 2 and calculate the number of usable IPs
num_of_ips: >-
{{ opinionated.hosting_network.workload.cidr |
ansible.utils.ipsubnet((opinionated.hosting_network.workload.cidr.split('/')[1] |int)+1, 1) | ipsubnet(32) |int -1 }}
ansible.utils.ipsubnet((opinionated.hosting_network.workload.cidr.split('/')[1] |int)+1, 1) | ansible.utils.ipsubnet(32) |int -1 }}
workload_gateway: "{{ opinionated.hosting_network.workload.gateway }}"
workload_ip_range_list:
# formula to split the workload subnet in 2 and take the first available IP
- starting_ip: "{{ opinionated.hosting_network.workload.cidr | ansible.utils.ipmath(3) }}"
# formula to split the workload subnet in 2 and calculate the number of usable IPs
num_of_ips: >-
{{ opinionated.hosting_network.workload.cidr |
ansible.utils.ipsubnet((opinionated.hosting_network.workload.cidr.split('/')[1] |int)+1, 0) | ipsubnet(32) |int -4 }}
ansible.utils.ipsubnet((opinionated.hosting_network.workload.cidr.split('/')[1] |int)+1, 0) | ansible.utils.ipsubnet(32) |int -4 }}
workload_netmask: "{{ opinionated.hosting_network.workload.cidr | ansible.utils.ipaddr('netmask') }}"
workload_port_group: workload-pg

Expand Down

0 comments on commit 2cf8eff

Please sign in to comment.