Add netscaler_gslb_vserver (#27640)

This commit is contained in:
George Nikolopoulos
2017-08-03 14:32:10 +03:00
committed by John R Barker
parent 60b3f80c6c
commit e2f907ae3e
18 changed files with 2256 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
---
testcase: "*"
test_cases: []
nitro_user: nsroot
nitro_pass: nsroot

View File

@@ -0,0 +1,7 @@
---
- { include: testbed.yaml, state: present }
- { include: nitro.yaml, tags: ['nitro'] }
- { include: testbed.yaml, state: absent }

View File

@@ -0,0 +1,14 @@
- name: collect all nitro test cases
find:
paths: "{{ role_path }}/tests/nitro"
patterns: "{{ testcase }}.yaml"
register: test_cases
- name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case
include: "{{ test_case_to_run }}"
with_items: "{{ test_items }}"
loop_control:
loop_var: test_case_to_run

View File

@@ -0,0 +1,39 @@
---
- name: Setup gslb site
netscaler_gslb_site:
nitro_user: "{{nitro_user}}"
nitro_pass: "{{nitro_pass}}"
nsip: "{{nsip}}"
state: "{{ state }}"
sitename: gslb-site-1
siteipaddress: 192.168.1.1
sitetype: LOCAL
publicip: 192.168.1.1
metricexchange: ENABLED
nwmetricexchange: ENABLED
sessionexchange: ENABLED
triggermonitor: ALWAYS
delegate_to: localhost
register: result
- name: Setup gslb service
delegate_to: localhost
register: result
netscaler_gslb_service:
nitro_user: "{{nitro_user}}"
nitro_pass: "{{nitro_pass}}"
nsip: "{{nsip}}"
state: "{{ state }}"
servicename: gslb-service-1
servicetype: HTTP
sitename: gslb-site-1
ipaddress: 10.10.10.11
port: 80

View File

@@ -0,0 +1,9 @@
---
- include: "{{ role_path }}/tests/nitro/flap_disabled/setup.yaml"
vars:
check_mode: no
- include: "{{ role_path }}/tests/nitro/flap_disabled/remove.yaml"
vars:
check_mode: no

View File

@@ -0,0 +1,12 @@
---
- name: remove http lb vserver
register: result
check_mode: "{{ check_mode }}"
delegate_to: localhost
netscaler_gslb_vserver:
nitro_user: "{{nitro_user}}"
nitro_pass: "{{nitro_pass}}"
nsip: "{{nsip}}"
state: absent
name: gslb-vserver-2

View File

@@ -0,0 +1,39 @@
---
- name: flap gslb vserver
register: result
check_mode: "{{ check_mode }}"
delegate_to: localhost
netscaler_gslb_vserver:
nitro_user: "{{nitro_user}}"
nitro_pass: "{{nitro_pass}}"
nsip: "{{nsip}}"
name: gslb-vserver-2
servicetype: HTTP
lbmethod: SOURCEIPHASH
netmask: 255.255.255.0
v6persistmasklen: 128
disabled: "{{ item|int % 2 }}"
with_sequence: count=20
delay: 1
- name: flap gslb vserver
register: result
check_mode: "{{ check_mode }}"
delegate_to: localhost
netscaler_gslb_vserver:
nitro_user: "{{nitro_user}}"
nitro_pass: "{{nitro_pass}}"
nsip: "{{nsip}}"
name: gslb-vserver-2
servicetype: HTTP
lbmethod: SOURCEIPHASH
netmask: 255.255.255.0
v6persistmasklen: 128
disabled: "{{ item|int % 2 }}"
with_sequence: count=20
delay: 5

View File

@@ -0,0 +1,141 @@
---
- include: "{{ role_path }}/tests/nitro/http/setup.yaml"
vars:
check_mode: yes
- assert:
that: result|changed
- include: "{{ role_path }}/tests/nitro/http/setup.yaml"
vars:
check_mode: no
- assert:
that: result|changed
- include: "{{ role_path }}/tests/nitro/http/setup.yaml"
vars:
check_mode: yes
- assert:
that: not result|changed
- include: "{{ role_path }}/tests/nitro/http/setup.yaml"
vars:
check_mode: no
- assert:
that: not result|changed
- include: "{{ role_path }}/tests/nitro/http/update.yaml"
vars:
check_mode: yes
- assert:
that: result|changed
- include: "{{ role_path }}/tests/nitro/http/update.yaml"
vars:
check_mode: no
- assert:
that: result|changed
- include: "{{ role_path }}/tests/nitro/http/update.yaml"
vars:
check_mode: yes
- assert:
that: not result|changed
- include: "{{ role_path }}/tests/nitro/http/update.yaml"
vars:
check_mode: no
- assert:
that: not result|changed
- include: "{{ role_path }}/tests/nitro/http/update_domainbinding.yaml"
vars:
check_mode: yes
- assert:
that: result|changed
- include: "{{ role_path }}/tests/nitro/http/update_domainbinding.yaml"
vars:
check_mode: no
- assert:
that: result|changed
- include: "{{ role_path }}/tests/nitro/http/update_domainbinding.yaml"
vars:
check_mode: yes
- assert:
that: not result|changed
- include: "{{ role_path }}/tests/nitro/http/update_domainbinding.yaml"
vars:
check_mode: no
- assert:
that: not result|changed
- include: "{{ role_path }}/tests/nitro/http/update_gslbservice_binding.yaml"
vars:
check_mode: yes
- assert:
that: result|changed
- include: "{{ role_path }}/tests/nitro/http/update_gslbservice_binding.yaml"
vars:
check_mode: no
- assert:
that: result|changed
- include: "{{ role_path }}/tests/nitro/http/update_gslbservice_binding.yaml"
vars:
check_mode: yes
- assert:
that: not result|changed
- include: "{{ role_path }}/tests/nitro/http/update_gslbservice_binding.yaml"
vars:
check_mode: no
- assert:
that: not result|changed
- include: "{{ role_path }}/tests/nitro/http/remove.yaml"
vars:
check_mode: yes
- assert:
that: result|changed
- include: "{{ role_path }}/tests/nitro/http/remove.yaml"
vars:
check_mode: no
- assert:
that: result|changed
- include: "{{ role_path }}/tests/nitro/http/remove.yaml"
vars:
check_mode: yes
- assert:
that: not result|changed
- include: "{{ role_path }}/tests/nitro/http/remove.yaml"
vars:
check_mode: no
- assert:
that: not result|changed

View File

@@ -0,0 +1,15 @@
---
- name: Remove gslb vserver
delegate_to: localhost
register: result
check_mode: "{{ check_mode }}"
netscaler_gslb_vserver:
nitro_user: "{{nitro_user}}"
nitro_pass: "{{nitro_pass}}"
nsip: "{{nsip}}"
state: absent
name: gslb-vserver-1

View File

@@ -0,0 +1,46 @@
---
- name: Setup gslb vserver
delegate_to: localhost
register: result
check_mode: "{{ check_mode }}"
netscaler_gslb_vserver:
nitro_user: "{{nitro_user}}"
nitro_pass: "{{nitro_pass}}"
nsip: "{{nsip}}"
name: gslb-vserver-1
servicetype: HTTP
dnsrecordtype: A
lbmethod: ROUNDROBIN
backuplbmethod: RTT
tolerance: 50
persistencetype: NONE
persistenceid: 500
persistmask: 255.255.255.0
v6persistmasklen: 128
timeout: 1000
mir: DISABLED
disableprimaryondown: DISABLED
dynamicweight: DISABLED
considereffectivestate: NONE
comment: some comment
somethod: CONNECTION
sopersistence: DISABLED
sopersistencetimeout: 100
sothreshold: 5000
sobackupaction: DROP
appflowlog: DISABLED
domain_bindings:
- domainname: example.com
cookietimeout: 100
backupip: 10.10.10.10
ttl: 100
sitedomainttl: 200
service_bindings:
- weight: 100
servicename: gslb-service-1

View File

@@ -0,0 +1,46 @@
---
- name: Setup gslb vserver
delegate_to: localhost
register: result
check_mode: "{{ check_mode }}"
netscaler_gslb_vserver:
nitro_user: "{{nitro_user}}"
nitro_pass: "{{nitro_pass}}"
nsip: "{{nsip}}"
name: gslb-vserver-1
servicetype: HTTP
dnsrecordtype: A
lbmethod: ROUNDROBIN
backuplbmethod: RTT
tolerance: 50
persistencetype: NONE
persistenceid: 500
persistmask: 255.255.255.0
v6persistmasklen: 128
timeout: 500
mir: DISABLED
disableprimaryondown: DISABLED
dynamicweight: DISABLED
considereffectivestate: NONE
comment: some comment
somethod: CONNECTION
sopersistence: DISABLED
sopersistencetimeout: 100
sothreshold: 5000
sobackupaction: DROP
appflowlog: DISABLED
domain_bindings:
- domainname: example.com
cookietimeout: 100
backupip: 10.10.10.10
ttl: 100
sitedomainttl: 200
service_bindings:
- weight: 100
servicename: gslb-service-1

View File

@@ -0,0 +1,46 @@
---
- name: Setup gslb vserver
delegate_to: localhost
register: result
check_mode: "{{ check_mode }}"
netscaler_gslb_vserver:
nitro_user: "{{nitro_user}}"
nitro_pass: "{{nitro_pass}}"
nsip: "{{nsip}}"
name: gslb-vserver-1
servicetype: HTTP
dnsrecordtype: A
lbmethod: ROUNDROBIN
backuplbmethod: RTT
tolerance: 50
persistencetype: NONE
persistenceid: 500
persistmask: 255.255.255.0
v6persistmasklen: 128
timeout: 500
mir: DISABLED
disableprimaryondown: DISABLED
dynamicweight: DISABLED
considereffectivestate: NONE
comment: some comment
somethod: CONNECTION
sopersistence: DISABLED
sopersistencetimeout: 100
sothreshold: 5000
sobackupaction: DROP
appflowlog: DISABLED
domain_bindings:
- domainname: anotherexample.com
cookietimeout: 100
backupip: 10.10.10.10
ttl: 100
sitedomainttl: 200
service_bindings:
- weight: 100
servicename: gslb-service-1

View File

@@ -0,0 +1,46 @@
---
- name: Setup gslb vserver
delegate_to: localhost
register: result
check_mode: "{{ check_mode }}"
netscaler_gslb_vserver:
nitro_user: "{{nitro_user}}"
nitro_pass: "{{nitro_pass}}"
nsip: "{{nsip}}"
name: gslb-vserver-1
servicetype: HTTP
dnsrecordtype: A
lbmethod: ROUNDROBIN
backuplbmethod: RTT
tolerance: 50
persistencetype: NONE
persistenceid: 500
persistmask: 255.255.255.0
v6persistmasklen: 128
timeout: 500
mir: DISABLED
disableprimaryondown: DISABLED
dynamicweight: DISABLED
considereffectivestate: NONE
comment: some comment
somethod: CONNECTION
sopersistence: DISABLED
sopersistencetimeout: 100
sothreshold: 5000
sobackupaction: DROP
appflowlog: DISABLED
domain_bindings:
- domainname: example.com
cookietimeout: 100
backupip: 10.10.10.10
ttl: 200
sitedomainttl: 200
service_bindings:
- weight: 50
servicename: gslb-service-1

View File

@@ -0,0 +1,57 @@
---
- include: "{{ role_path }}/tests/nitro/sourceiphash/setup.yaml"
vars:
check_mode: yes
- assert:
that: result|changed
- include: "{{ role_path }}/tests/nitro/sourceiphash/setup.yaml"
vars:
check_mode: no
- assert:
that: result|changed
- include: "{{ role_path }}/tests/nitro/sourceiphash/setup.yaml"
vars:
check_mode: yes
- assert:
that: not result|changed
- include: "{{ role_path }}/tests/nitro/sourceiphash/setup.yaml"
vars:
check_mode: no
- assert:
that: not result|changed
- include: "{{ role_path }}/tests/nitro/sourceiphash/remove.yaml"
vars:
check_mode: yes
- assert:
that: result|changed
- include: "{{ role_path }}/tests/nitro/sourceiphash/remove.yaml"
vars:
check_mode: no
- assert:
that: result|changed
- include: "{{ role_path }}/tests/nitro/sourceiphash/remove.yaml"
vars:
check_mode: yes
- assert:
that: not result|changed
- include: "{{ role_path }}/tests/nitro/sourceiphash/remove.yaml"
vars:
check_mode: no
- assert:
that: not result|changed

View File

@@ -0,0 +1,16 @@
---
- name: Remove sourceiphash glsb vserver
delegate_to: localhost
register: result
check_mode: "{{ check_mode }}"
netscaler_gslb_vserver:
nitro_user: "{{nitro_user}}"
nitro_pass: "{{nitro_pass}}"
nsip: "{{nsip}}"
state: absent
name: gslb-vserver-2

View File

@@ -0,0 +1,18 @@
---
- name: Setup sourceiphash gslb vserver
delegate_to: localhost
register: result
check_mode: "{{ check_mode }}"
netscaler_gslb_vserver:
nitro_user: "{{nitro_user}}"
nitro_pass: "{{nitro_pass}}"
nsip: "{{nsip}}"
name: gslb-vserver-2
servicetype: HTTP
lbmethod: SOURCEIPHASH
netmask: 255.255.255.0
v6persistmasklen: 128