mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
Add netscaler_gslb_vserver (#27640)
This commit is contained in:
committed by
John R Barker
parent
60b3f80c6c
commit
e2f907ae3e
@@ -0,0 +1,6 @@
|
||||
---
|
||||
testcase: "*"
|
||||
test_cases: []
|
||||
|
||||
nitro_user: nsroot
|
||||
nitro_pass: nsroot
|
||||
@@ -0,0 +1,7 @@
|
||||
---
|
||||
|
||||
- { include: testbed.yaml, state: present }
|
||||
|
||||
- { include: nitro.yaml, tags: ['nitro'] }
|
||||
|
||||
- { include: testbed.yaml, state: absent }
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user