Add module netscaler_cs_action (#26147)

This commit is contained in:
George Nikolopoulos
2017-06-28 16:46:46 +03:00
committed by Ganesh Nalawade
parent a5b905c941
commit 11836a0296
14 changed files with 1192 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]
netscaler01 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,16 @@
---
- name: Setup lb vserver
delegate_to: localhost
netscaler_lb_vserver:
nitro_user: "{{nitro_user}}"
nitro_pass: "{{nitro_pass}}"
nsip: "{{nsip}}"
state: "{{ state }}"
name: lb-vserver-1
ipv46: 10.79.1.4
port: 80
servicetype: ANY

View File

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

View File

@@ -0,0 +1,13 @@
---
- name: Setup cs action
delegate_to: localhost
register: result
check_mode: "{{ check_mode }}"
netscaler_cs_action:
nitro_user: "{{nitro_user}}"
nitro_pass: "{{nitro_pass}}"
nsip: "{{nsip}}"
state: absent
name: action-2

View File

@@ -0,0 +1,14 @@
---
- name: Setup cs action
delegate_to: localhost
register: result
check_mode: "{{ check_mode }}"
netscaler_cs_action:
nitro_user: "{{nitro_user}}"
nitro_pass: "{{nitro_pass}}"
nsip: "{{nsip}}"
name: action-2
targetvserverexpr: '"mylb_" + HTTP.REQ.URL.SUFFIX'

View File

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

View File

@@ -0,0 +1,13 @@
---
- name: Setup cs action
delegate_to: localhost
register: result
check_mode: "{{ check_mode }}"
netscaler_cs_action:
nitro_user: "{{nitro_user}}"
nitro_pass: "{{nitro_pass}}"
nsip: "{{nsip}}"
state: absent
name: action-1

View File

@@ -0,0 +1,15 @@
---
- name: Setup cs action
delegate_to: localhost
register: result
check_mode: "{{ check_mode }}"
netscaler_cs_action:
nitro_user: "{{nitro_user}}"
nitro_pass: "{{nitro_pass}}"
nsip: "{{nsip}}"
name: action-1
targetlbvserver: lb-vserver-1
comment: some comment

View File

@@ -0,0 +1,14 @@
---
- name: Update cs action
delegate_to: localhost
register: result
check_mode: "{{ check_mode }}"
netscaler_cs_action:
nitro_user: "{{nitro_user}}"
nitro_pass: "{{nitro_pass}}"
nsip: "{{nsip}}"
name: action-1
targetlbvserver: lb-vserver-1
comment: some other comment