Skip to content

Instantly share code, notes, and snippets.

@ngschmidt
Last active March 6, 2022 16:53
Show Gist options
  • Save ngschmidt/ea4caf3e676d572719eb9e2a3fb152d1 to your computer and use it in GitHub Desktop.
Save ngschmidt/ea4caf3e676d572719eb9e2a3fb152d1 to your computer and use it in GitHub Desktop.
VMware NSX-T Ansible Segment Creation Example
---
- hosts: localhost
tasks:
- name: "Creating segment {{ segment_name }}!"
vmware.ansible_for_nsxt.nsxt_policy_segment:
hostname: "{{ nsx_manager }}"
username: '{{ lookup("env", "APIUSER") }}'
password: '{{ lookup("env", "APIPASS") }}'
validate_certs: False
state: present
display_name: "{{ segment_name }}"
transport_zone_display_name: "{{ segment_tz }}"
replication_mode: "SOURCE"
admin_state: UP
connectivity_path: "/infra/tier-1s/{{ tier_1 }}"
subnets:
- gateway_address: "{{ ipv4 }}"
---
nsx_manager: "nsx.engyak.co"
segment_name: "example_segment_name"
segment_tz: "overlay-tz"
tier_1: "tier1"
ipv4: "10.100.100.100/24"
---
nsx_manager: "nsx.engyak.co"
segment_name: "example_segment_name"
segment_tz: "overlay-tz"
tier_1: "tier1"
ipv4: "10.100.100.99/24"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment