New module: manage Citrix Netscaler servicegroup configuration (network/netscaler/netscaler_servicegroup)) (#26183)

* Add netscaler_servicegroup

* Correct version_added
This commit is contained in:
George Nikolopoulos 2017-08-01 20:34:28 +03:00 committed by John R Barker
commit e329c9da8c
16 changed files with 1941 additions and 0 deletions

View file

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

View file

@ -0,0 +1,5 @@
[netscaler]
172.18.0.2 nsip=172.18.0.2 nitro_user=nsroot nitro_pass=nsroot

View file

@ -0,0 +1,6 @@
---
- { 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,21 @@
- name: setup monitor
delegate_to: localhost
netscaler_lb_monitor:
nitro_user: "{{nitro_user}}"
nitro_pass: "{{nitro_pass}}"
nsip: "{{nsip}}"
state: "{{ state }}"
monitorname: monitor-1
type: HTTP
- name: setup monitor
delegate_to: localhost
netscaler_lb_monitor:
nitro_user: "{{nitro_user}}"
nitro_pass: "{{nitro_pass}}"
nsip: "{{nsip}}"
state: "{{ state }}"
monitorname: monitor-2
type: HTTP

View file

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

View file

@ -0,0 +1,16 @@
---
- name: Remove servicegroup
delegate_to: localhost
register: result
check_mode: "{{ check_mode }}"
netscaler_servicegroup:
nitro_user: "{{nitro_user}}"
nitro_pass: "{{nitro_pass}}"
nsip: "{{nsip}}"
state: absent
servicegroupname: service-group-1
servicetype: HTTP

View file

@ -0,0 +1,46 @@
---
- name: Setup servicegroup
delegate_to: localhost
register: result
check_mode: "{{ check_mode }}"
netscaler_servicegroup:
nitro_user: "{{nitro_user}}"
nitro_pass: "{{nitro_pass}}"
nsip: "{{nsip}}"
state: present
servicegroupname: service-group-1
servicetype: HTTP
cachetype: TRANSPARENT
maxclient: 100
maxreq: 100
cacheable: no
cip: ENABLED
cipheader: cip-header
usip: no
pathmonitor: no
pathmonitorindv: no
useproxyport: no
healthmonitor: no
sc: off
sp: off
rtspsessionidremap: off
clttimeout: 2000
svrtimeout: 2000
cka: yes
tcpb: yes
cmp: no
maxbandwidth: 5000
monthreshold: 100
downstateflush: DISABLED
comment: some comment
appflowlog: ENABLED
autoscale: POLICY
memberport: 80
graceful: no
servicemembers:
- ip: 10.78.78.78
port: 80
weight: 100

View file

@ -0,0 +1,49 @@
---
- name: Setup servicegroup
delegate_to: localhost
register: result
check_mode: "{{ check_mode }}"
netscaler_servicegroup:
nitro_user: "{{nitro_user}}"
nitro_pass: "{{nitro_pass}}"
nsip: "{{nsip}}"
state: present
servicegroupname: service-group-1
servicetype: HTTP
cachetype: TRANSPARENT
maxclient: 100
maxreq: 100
cacheable: no
cip: ENABLED
cipheader: cip-header
usip: no
pathmonitor: no
pathmonitorindv: no
useproxyport: no
healthmonitor: no
sc: off
sp: off
rtspsessionidremap: off
clttimeout: 1000
svrtimeout: 1000
cka: yes
tcpb: yes
cmp: no
maxbandwidth: 5000
monthreshold: 100
downstateflush: DISABLED
comment: some comment
appflowlog: ENABLED
autoscale: POLICY
memberport: 80
graceful: no
servicemembers:
- ip: 10.78.78.78
port: 80
weight: 50
- ip: 10.79.79.79
port: 80
weight: 50

View file

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

View file

@ -0,0 +1,18 @@
---
- name: Setup servicegroup
delegate_to: localhost
register: result
check_mode: "{{ check_mode }}"
netscaler_servicegroup:
nitro_user: "{{nitro_user}}"
nitro_pass: "{{nitro_pass}}"
nsip: "{{nsip}}"
servicegroupname: service-group-1
servicetype: HTTP
servicemembers:
- ip: 10.78.78.78
port: 80
weight: 100

View file

@ -0,0 +1,16 @@
---
- name: Remove servicegroup
delegate_to: localhost
register: result
check_mode: "{{ check_mode }}"
netscaler_servicegroup:
nitro_user: "{{nitro_user}}"
nitro_pass: "{{nitro_pass}}"
nsip: "{{nsip}}"
state: absent
servicegroupname: service-group-1
servicetype: HTTP

View file

@ -0,0 +1,23 @@
---
- name: Setup servicegroup
delegate_to: localhost
register: result
check_mode: "{{ check_mode }}"
netscaler_servicegroup:
nitro_user: "{{nitro_user}}"
nitro_pass: "{{nitro_pass}}"
nsip: "{{nsip}}"
servicegroupname: service-group-1
servicetype: HTTP
servicemembers:
- ip: 10.78.78.78
port: 80
weight: 100
monitorbindings:
- monitorname: monitor-1
weight: 50
- monitorname: monitor-2
weight: 50

View file

@ -0,0 +1,23 @@
---
- name: Setup servicegroup
delegate_to: localhost
register: result
check_mode: "{{ check_mode }}"
netscaler_servicegroup:
nitro_user: "{{nitro_user}}"
nitro_pass: "{{nitro_pass}}"
nsip: "{{nsip}}"
servicegroupname: service-group-1
servicetype: HTTP
servicemembers:
- ip: 10.78.78.78
port: 80
weight: 100
monitorbindings:
- monitorname: monitor-1
weight: 80
- monitorname: monitor-2
weight: 20