Skip to content

Instantly share code, notes, and snippets.

@laidbackware
Last active May 29, 2019 20:49
Show Gist options
  • Save laidbackware/fd01b5addcce0552aee3f6552ad5fcc4 to your computer and use it in GitHub Desktop.
Save laidbackware/fd01b5addcce0552aee3f6552ad5fcc4 to your computer and use it in GitHub Desktop.
nsxt_tutorials_1_playbook
---
- hosts: 127.0.0.1
connection: local
tasks:
- name: Create a new IP Set
nsxt_ip_sets:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
validate_certs: "{{ validate_certs }}"
display_name: "{{ item.display_name }}"
ip_addresses: "{{ item.ip_addresses }}"
state: "{{ item.tags | default('present') }}"
with_items:
- "{{ nsxt_ip_sets }}"
- name: Create DFW Section with Rules
nsxt_firewall_section_with_rules:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
validate_certs: "{{ validate_certs }}"
display_name: "{{ item.display_name }}"
rules: "{{ item.rules | default([]) }}"
state: "{{ item.tags | default('present') }}"
stateful: "{{ item.stateful | default(True) }}"
with_items:
- "{{ nsxt_firewall_section }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment