mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-23 04:24:00 -07:00
New module: manage Citrix Netscaler GSLB service configuration (network/netscaler/netscaler_gslb_service)) (#27638)
* Add netscaler_gslb_service * Lowercase enabled, disabled option values * Add fixes in netscaler module utils needed for unit test success
This commit is contained in:
parent
cd865be987
commit
d88c07a037
18 changed files with 1745 additions and 3 deletions
|
|
@ -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,34 @@
|
|||
---
|
||||
|
||||
- name: Setup gslb site
|
||||
delegate_to: localhost
|
||||
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
|
||||
|
||||
- name: setup lb monitor
|
||||
delegate_to: localhost
|
||||
netscaler_lb_monitor:
|
||||
nitro_user: "{{nitro_user}}"
|
||||
nitro_pass: "{{nitro_pass}}"
|
||||
nsip: "{{nsip}}"
|
||||
|
||||
state: "{{ state }}"
|
||||
|
||||
monitorname: lb-monitor-1
|
||||
type: TCP-ECV
|
||||
|
||||
send: sendstring
|
||||
recv: recvstring
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
---
|
||||
|
||||
- name: Setup gslb service cname
|
||||
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
check_mode: "{{ check_mode }}"
|
||||
|
||||
netscaler_gslb_service:
|
||||
operation: absent
|
||||
|
||||
servicename: gslb-service-2
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
---
|
||||
|
||||
- name: Setup gslb service 2
|
||||
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
check_mode: "{{ check_mode }}"
|
||||
|
||||
netscaler_gslb_service:
|
||||
operation: present
|
||||
|
||||
servicename: gslb-service-2
|
||||
cnameentry: example.com
|
||||
sitename: gslb-site-1
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
---
|
||||
|
||||
- name: Setup gslb service 2
|
||||
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
check_mode: "{{ check_mode }}"
|
||||
|
||||
netscaler_gslb_service:
|
||||
operation: present
|
||||
|
||||
servicename: gslb-service-2
|
||||
cnameentry: example.com
|
||||
comment: added comment
|
||||
sitename: gslb-site-1
|
||||
|
|
@ -0,0 +1,85 @@
|
|||
---
|
||||
|
||||
- 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/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 service
|
||||
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
check_mode: "{{ check_mode }}"
|
||||
|
||||
netscaler_gslb_service:
|
||||
nitro_user: "{{nitro_user}}"
|
||||
nitro_pass: "{{nitro_pass}}"
|
||||
nsip: "{{nsip}}"
|
||||
|
||||
state: absent
|
||||
servicename: gslb-service-1
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
---
|
||||
|
||||
- name: Setup gslb service
|
||||
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
check_mode: "{{ check_mode }}"
|
||||
|
||||
netscaler_gslb_service:
|
||||
nitro_user: "{{nitro_user}}"
|
||||
nitro_pass: "{{nitro_pass}}"
|
||||
nsip: "{{nsip}}"
|
||||
|
||||
servicename: gslb-service-1
|
||||
servicetype: HTTP
|
||||
sitename: gslb-site-1
|
||||
ipaddress: 10.10.10.11
|
||||
port: 80
|
||||
publicip: 10.10.10.11
|
||||
publicport: 80
|
||||
maxclient: 100
|
||||
healthmonitor: "NO"
|
||||
cip: enabled
|
||||
cipheader: hello
|
||||
sitepersistence: NONE
|
||||
siteprefix: prefix
|
||||
clttimeout: 100
|
||||
maxbandwidth: 100
|
||||
downstateflush: enabled
|
||||
maxaaausers: 100
|
||||
monthreshold: 500
|
||||
hashid: 10
|
||||
comment: cool gslb service!
|
||||
appflowlog: enabled
|
||||
|
||||
monitor_bindings:
|
||||
-
|
||||
monitor_name: lb-monitor-1
|
||||
weight: 100
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
---
|
||||
|
||||
- name: Setup gslb service
|
||||
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
check_mode: "{{ check_mode }}"
|
||||
|
||||
netscaler_gslb_service:
|
||||
nitro_user: "{{nitro_user}}"
|
||||
nitro_pass: "{{nitro_pass}}"
|
||||
nsip: "{{nsip}}"
|
||||
|
||||
servicename: gslb-service-1
|
||||
servicetype: HTTP
|
||||
sitename: gslb-site-1
|
||||
ipaddress: 10.10.10.11
|
||||
port: 80
|
||||
publicip: 10.10.10.11
|
||||
publicport: 80
|
||||
maxclient: 100
|
||||
healthmonitor: "NO"
|
||||
cip: enabled
|
||||
cipheader: hello
|
||||
sitepersistence: NONE
|
||||
siteprefix: prefix
|
||||
clttimeout: 100
|
||||
maxbandwidth: 100
|
||||
downstateflush: enabled
|
||||
maxaaausers: 100
|
||||
monthreshold: 500
|
||||
hashid: 10
|
||||
comment: some other comment
|
||||
appflowlog: enabled
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
---
|
||||
|
||||
- name: Remove gslb-service-3
|
||||
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
check_mode: "{{ check_mode }}"
|
||||
|
||||
netscaler_gslb_service:
|
||||
operation: absent
|
||||
|
||||
servicename: gslb-service-3
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
---
|
||||
|
||||
- name: Setup gslb service 3
|
||||
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
check_mode: "{{ check_mode }}"
|
||||
|
||||
netscaler_gslb_service:
|
||||
operation: present
|
||||
|
||||
servicename: gslb-service-3
|
||||
servername: 10.10.10.10
|
||||
servicetype: HTTP
|
||||
port: 80
|
||||
sitename: gslb-site-1
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
---
|
||||
|
||||
- name: Setup gslb service 3
|
||||
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
check_mode: "{{ check_mode }}"
|
||||
|
||||
netscaler_gslb_service:
|
||||
operation: present
|
||||
|
||||
servicename: gslb-service-3
|
||||
servername: 10.10.10.10
|
||||
servicetype: HTTP
|
||||
port: 80
|
||||
comment: added comment
|
||||
sitename: gslb-site-1
|
||||
|
|
@ -23,7 +23,6 @@
|
|||
cipheader: client-ip
|
||||
usip: yes
|
||||
useproxyport: yes
|
||||
sc: off
|
||||
sp: off
|
||||
rtspsessionidremap: off
|
||||
clttimeout: 100
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@
|
|||
cipheader: client-ip
|
||||
usip: yes
|
||||
useproxyport: yes
|
||||
sc: off
|
||||
sp: off
|
||||
rtspsessionidremap: off
|
||||
clttimeout: 100
|
||||
|
|
@ -40,7 +39,6 @@
|
|||
comment: some comment
|
||||
appflowlog: ENABLED
|
||||
processlocal: ENABLED
|
||||
netprofile: net-profile-1
|
||||
|
||||
monitor_bindings:
|
||||
- monitorname: http
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue