forked from vmware-archive/nsxansible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_edge_nat.yml
44 lines (41 loc) · 1.09 KB
/
test_edge_nat.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
---
- hosts: localhost
connection: local
gather_facts: False
vars_files:
- nsxanswer.yml
tasks:
- name: Create SSH DNAT rule
nsx_edge_nat:
nsxmanager_spec: '{{ nsxmanager_spec }}'
mode: 'create'
name: '{{ edge_name }}'
description: 'Ansible created DNAT rule'
loggingEnabled: 'true'
rule_type: 'dnat'
vnic: '0'
protocol: 'tcp'
originalAddress: '10.0.0.1'
originalPort: '22'
translatedAddress: '192.168.0.2'
translatedPort: '22'
- name: Create default outbound SNAT rule
nsx_edge_nat:
nsxmanager_spec: '{{ nsxmanager_spec }}'
mode: 'create'
name: '{{ edge_name }}'
description: 'Ansible created SNAT rule'
loggingEnabled: 'true'
rule_type: 'snat'
vnic: '0'
protocol: 'any'
originalAddress: '192.168.0.0/20'
originalPort: 'any'
translatedAddress: '10.0.0.1'
translatedPort: 'any'
- name: Delete NAT rule
nsx_edge_nat:
nsxmanager_spec: '{{ nsxmanager_spec }}'
mode: 'delete'
name: '{{ edge_name }}'
ruleId: '192622'