mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-24 04:54:00 -07:00
Add enable, disable operation in netscaler_service (#28321)
This commit is contained in:
parent
fbeb3b9ac5
commit
2281a6676b
7 changed files with 115 additions and 8 deletions
|
|
@ -0,0 +1,10 @@
|
|||
---
|
||||
|
||||
- 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,16 @@
|
|||
---
|
||||
|
||||
- name: Remove htttp service
|
||||
netscaler_service:
|
||||
|
||||
nitro_user: "{{nitro_user}}"
|
||||
nitro_pass: "{{nitro_pass}}"
|
||||
nsip: "{{nsip}}"
|
||||
|
||||
state: absent
|
||||
|
||||
name: service-http
|
||||
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
check_mode: "{{ check_mode }}"
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
---
|
||||
|
||||
- name: Flap service
|
||||
netscaler_service:
|
||||
|
||||
nitro_user: "{{nitro_user}}"
|
||||
nitro_pass: "{{nitro_pass}}"
|
||||
nsip: "{{nsip}}"
|
||||
|
||||
state: present
|
||||
|
||||
name: service-http
|
||||
ip: 192.168.1.1
|
||||
ipaddress: 192.168.1.1
|
||||
port: 80
|
||||
servicetype: HTTP
|
||||
|
||||
disabled: "{{ item|int % 2 }}"
|
||||
with_sequence: count=20
|
||||
delay: 1
|
||||
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
check_mode: "{{ check_mode }}"
|
||||
|
||||
- name: Flap service
|
||||
netscaler_service:
|
||||
|
||||
nitro_user: "{{nitro_user}}"
|
||||
nitro_pass: "{{nitro_pass}}"
|
||||
nsip: "{{nsip}}"
|
||||
|
||||
state: present
|
||||
|
||||
name: service-http
|
||||
ip: 192.168.1.1
|
||||
ipaddress: 192.168.1.1
|
||||
port: 80
|
||||
servicetype: HTTP
|
||||
|
||||
disabled: "{{ item|int % 2 }}"
|
||||
with_sequence: count=20
|
||||
delay: 5
|
||||
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
check_mode: "{{ check_mode }}"
|
||||
|
|
@ -19,7 +19,7 @@
|
|||
healthmonitor: no
|
||||
maxreq: 200
|
||||
cacheable: no
|
||||
cip: ENABLED
|
||||
cip: enabled
|
||||
cipheader: client-ip
|
||||
usip: yes
|
||||
useproxyport: yes
|
||||
|
|
@ -34,11 +34,11 @@
|
|||
maxbandwidth: 10000
|
||||
accessdown: "NO"
|
||||
monthreshold: 100
|
||||
downstateflush: ENABLED
|
||||
downstateflush: enabled
|
||||
hashid: 10
|
||||
comment: some comment
|
||||
appflowlog: ENABLED
|
||||
processlocal: ENABLED
|
||||
appflowlog: enabled
|
||||
processlocal: enabled
|
||||
graceful: no
|
||||
|
||||
monitor_bindings:
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
healthmonitor: no
|
||||
maxreq: 200
|
||||
cacheable: no
|
||||
cip: ENABLED
|
||||
cip: enabled
|
||||
cipheader: client-ip
|
||||
usip: yes
|
||||
useproxyport: yes
|
||||
|
|
@ -34,11 +34,11 @@
|
|||
maxbandwidth: 20000
|
||||
accessdown: "NO"
|
||||
monthreshold: 100
|
||||
downstateflush: ENABLED
|
||||
downstateflush: enabled
|
||||
hashid: 10
|
||||
comment: some comment
|
||||
appflowlog: ENABLED
|
||||
processlocal: ENABLED
|
||||
appflowlog: enabled
|
||||
processlocal: enabled
|
||||
|
||||
monitor_bindings:
|
||||
- monitorname: http
|
||||
|
|
|
|||
|
|
@ -162,6 +162,7 @@ class TestNetscalerServiceModule(TestModule):
|
|||
'ansible.modules.network.netscaler.netscaler_service',
|
||||
ConfigProxy=m,
|
||||
service_exists=service_exists_mock,
|
||||
do_state_change=Mock(return_value=Mock(errorcode=0)),
|
||||
):
|
||||
self.module = netscaler_service
|
||||
result = self.exited()
|
||||
|
|
@ -190,6 +191,7 @@ class TestNetscalerServiceModule(TestModule):
|
|||
service_identical=service_identical_mock,
|
||||
monitor_bindings_identical=monitor_bindings_identical_mock,
|
||||
all_identical=all_identical_mock,
|
||||
do_state_change=Mock(return_value=Mock(errorcode=0)),
|
||||
):
|
||||
self.module = netscaler_service
|
||||
result = self.exited()
|
||||
|
|
@ -220,6 +222,7 @@ class TestNetscalerServiceModule(TestModule):
|
|||
monitor_bindings_identical=monitor_bindings_identical_mock,
|
||||
all_identical=all_identical_mock,
|
||||
sync_monitor_bindings=sync_monitor_bindings_mock,
|
||||
do_state_change=Mock(return_value=Mock(errorcode=0)),
|
||||
):
|
||||
self.module = netscaler_service
|
||||
result = self.exited()
|
||||
|
|
@ -247,6 +250,7 @@ class TestNetscalerServiceModule(TestModule):
|
|||
service_exists=service_exists_mock,
|
||||
service_identical=service_identical_mock,
|
||||
monitor_bindings_identical=monitor_bindings_identical_mock,
|
||||
do_state_change=Mock(return_value=Mock(errorcode=0)),
|
||||
):
|
||||
self.module = netscaler_service
|
||||
result = self.exited()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue