mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
Add netscaler_server module (#25537)
This commit is contained in:
committed by
Ganesh Nalawade
parent
96dcd1060c
commit
6bed831f8c
@@ -1,3 +1,5 @@
|
||||
---
|
||||
|
||||
- hosts: netscaler
|
||||
|
||||
gather_facts: no
|
||||
@@ -9,3 +11,4 @@
|
||||
|
||||
roles:
|
||||
- { role: netscaler_service, when: "limit_to in ['*', 'netscaler_service']" }
|
||||
- { role: netscaler_server, when: "limit_to in ['*', 'netscaler_server']" }
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
testcase: "*"
|
||||
test_cases: []
|
||||
|
||||
nitro_user: nsroot
|
||||
nitro_pass: nsroot
|
||||
5
test/integration/roles/netscaler_server/sample_inventory
Normal file
5
test/integration/roles/netscaler_server/sample_inventory
Normal file
@@ -0,0 +1,5 @@
|
||||
|
||||
|
||||
[netscaler]
|
||||
|
||||
netscaler01 nsip=172.18.0.2 nitro_user=nsroot nitro_pass=nsroot
|
||||
2
test/integration/roles/netscaler_server/tasks/main.yaml
Normal file
2
test/integration/roles/netscaler_server/tasks/main.yaml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
- { include: nitro.yaml, tags: ['nitro'] }
|
||||
14
test/integration/roles/netscaler_server/tasks/nitro.yaml
Normal file
14
test/integration/roles/netscaler_server/tasks/nitro.yaml
Normal 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
|
||||
@@ -0,0 +1,82 @@
|
||||
---
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/server/setup.yaml"
|
||||
vars:
|
||||
check_mode: yes
|
||||
|
||||
- assert:
|
||||
that: result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/server/setup.yaml"
|
||||
vars:
|
||||
check_mode: no
|
||||
|
||||
- assert:
|
||||
that: result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/server/setup.yaml"
|
||||
vars:
|
||||
check_mode: yes
|
||||
|
||||
- assert:
|
||||
that: not result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/server/setup.yaml"
|
||||
vars:
|
||||
check_mode: no
|
||||
|
||||
- assert:
|
||||
that: not result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/server/update.yaml"
|
||||
vars:
|
||||
check_mode: yes
|
||||
|
||||
- assert:
|
||||
that: result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/server/update.yaml"
|
||||
vars:
|
||||
check_mode: no
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/server/update.yaml"
|
||||
vars:
|
||||
check_mode: yes
|
||||
|
||||
- assert:
|
||||
that: not result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/server/update.yaml"
|
||||
vars:
|
||||
check_mode: no
|
||||
|
||||
- assert:
|
||||
that: not result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/server/remove.yaml"
|
||||
vars:
|
||||
check_mode: yes
|
||||
|
||||
- assert:
|
||||
that: result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/server/remove.yaml"
|
||||
vars:
|
||||
check_mode: no
|
||||
|
||||
- assert:
|
||||
that: result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/server/remove.yaml"
|
||||
vars:
|
||||
check_mode: yes
|
||||
|
||||
- assert:
|
||||
that: not result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/server/remove.yaml"
|
||||
vars:
|
||||
check_mode: no
|
||||
|
||||
- assert:
|
||||
that: not result|changed
|
||||
@@ -0,0 +1,15 @@
|
||||
---
|
||||
|
||||
- name: Remove basic server
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
check_mode: "{{ check_mode }}"
|
||||
netscaler_server:
|
||||
nitro_user: "{{nitro_user}}"
|
||||
nitro_pass: "{{nitro_pass}}"
|
||||
nsip: "{{nsip}}"
|
||||
|
||||
state: absent
|
||||
|
||||
name: test-server-1
|
||||
ipaddress: 10.10.10.10
|
||||
@@ -0,0 +1,16 @@
|
||||
---
|
||||
|
||||
- name: Setup basic server
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
check_mode: "{{ check_mode }}"
|
||||
netscaler_server:
|
||||
nitro_user: "{{nitro_user}}"
|
||||
nitro_pass: "{{nitro_pass}}"
|
||||
nsip: "{{nsip}}"
|
||||
|
||||
state: present
|
||||
|
||||
name: test-server-1
|
||||
ipaddress: 10.10.10.10
|
||||
comment: comment for server
|
||||
@@ -0,0 +1,16 @@
|
||||
---
|
||||
|
||||
- name: Setup basic server
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
check_mode: "{{ check_mode }}"
|
||||
netscaler_server:
|
||||
nitro_user: "{{nitro_user}}"
|
||||
nitro_pass: "{{nitro_pass}}"
|
||||
nsip: "{{nsip}}"
|
||||
|
||||
state: present
|
||||
|
||||
name: test-server-1
|
||||
ipaddress: 11.11.11.11
|
||||
disabled: yes
|
||||
@@ -0,0 +1,82 @@
|
||||
---
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/server_domain/setup.yaml"
|
||||
vars:
|
||||
check_mode: yes
|
||||
|
||||
- assert:
|
||||
that: result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/server_domain/setup.yaml"
|
||||
vars:
|
||||
check_mode: no
|
||||
|
||||
- assert:
|
||||
that: result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/server_domain/setup.yaml"
|
||||
vars:
|
||||
check_mode: yes
|
||||
|
||||
- assert:
|
||||
that: not result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/server_domain/setup.yaml"
|
||||
vars:
|
||||
check_mode: no
|
||||
|
||||
- assert:
|
||||
that: not result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/server_domain/update.yaml"
|
||||
vars:
|
||||
check_mode: yes
|
||||
|
||||
- assert:
|
||||
that: result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/server_domain/update.yaml"
|
||||
vars:
|
||||
check_mode: no
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/server_domain/update.yaml"
|
||||
vars:
|
||||
check_mode: yes
|
||||
|
||||
- assert:
|
||||
that: not result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/server_domain/update.yaml"
|
||||
vars:
|
||||
check_mode: no
|
||||
|
||||
- assert:
|
||||
that: not result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/server_domain/remove.yaml"
|
||||
vars:
|
||||
check_mode: yes
|
||||
|
||||
- assert:
|
||||
that: result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/server_domain/remove.yaml"
|
||||
vars:
|
||||
check_mode: no
|
||||
|
||||
- assert:
|
||||
that: result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/server_domain/remove.yaml"
|
||||
vars:
|
||||
check_mode: yes
|
||||
|
||||
- assert:
|
||||
that: not result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/server_domain/remove.yaml"
|
||||
vars:
|
||||
check_mode: no
|
||||
|
||||
- assert:
|
||||
that: not result|changed
|
||||
@@ -0,0 +1,14 @@
|
||||
---
|
||||
|
||||
- name: Remove basic server
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
check_mode: "{{ check_mode }}"
|
||||
netscaler_server:
|
||||
nitro_user: "{{nitro_user}}"
|
||||
nitro_pass: "{{nitro_pass}}"
|
||||
nsip: "{{nsip}}"
|
||||
|
||||
state: absent
|
||||
|
||||
name: test-server-domain
|
||||
@@ -0,0 +1,16 @@
|
||||
---
|
||||
|
||||
- name: Setup basic server
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
check_mode: "{{ check_mode }}"
|
||||
netscaler_server:
|
||||
nitro_user: "{{nitro_user}}"
|
||||
nitro_pass: "{{nitro_pass}}"
|
||||
nsip: "{{nsip}}"
|
||||
|
||||
state: present
|
||||
|
||||
name: test-server-domain
|
||||
domain: example.com
|
||||
ipv6address: no
|
||||
@@ -0,0 +1,18 @@
|
||||
---
|
||||
|
||||
- name: Setup basic server
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
check_mode: "{{ check_mode }}"
|
||||
netscaler_server:
|
||||
nitro_user: "{{nitro_user}}"
|
||||
nitro_pass: "{{nitro_pass}}"
|
||||
nsip: "{{nsip}}"
|
||||
|
||||
state: present
|
||||
|
||||
name: test-server-domain
|
||||
domain: example.com
|
||||
translationip: 192.168.1.1
|
||||
translationmask: 255.255.255.0
|
||||
domainresolveretry: 10
|
||||
@@ -0,0 +1,82 @@
|
||||
---
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/server_ipv6/setup.yaml"
|
||||
vars:
|
||||
check_mode: yes
|
||||
|
||||
- assert:
|
||||
that: result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/server_ipv6/setup.yaml"
|
||||
vars:
|
||||
check_mode: no
|
||||
|
||||
- assert:
|
||||
that: result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/server_ipv6/setup.yaml"
|
||||
vars:
|
||||
check_mode: yes
|
||||
|
||||
- assert:
|
||||
that: not result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/server_ipv6/setup.yaml"
|
||||
vars:
|
||||
check_mode: no
|
||||
|
||||
- assert:
|
||||
that: not result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/server_ipv6/update.yaml"
|
||||
vars:
|
||||
check_mode: yes
|
||||
|
||||
- assert:
|
||||
that: result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/server_ipv6/update.yaml"
|
||||
vars:
|
||||
check_mode: no
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/server_ipv6/update.yaml"
|
||||
vars:
|
||||
check_mode: yes
|
||||
|
||||
- assert:
|
||||
that: not result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/server_ipv6/update.yaml"
|
||||
vars:
|
||||
check_mode: no
|
||||
|
||||
- assert:
|
||||
that: not result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/server_ipv6/remove.yaml"
|
||||
vars:
|
||||
check_mode: yes
|
||||
|
||||
- assert:
|
||||
that: result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/server_ipv6/remove.yaml"
|
||||
vars:
|
||||
check_mode: no
|
||||
|
||||
- assert:
|
||||
that: result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/server_ipv6/remove.yaml"
|
||||
vars:
|
||||
check_mode: yes
|
||||
|
||||
- assert:
|
||||
that: not result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/server_ipv6/remove.yaml"
|
||||
vars:
|
||||
check_mode: no
|
||||
|
||||
- assert:
|
||||
that: not result|changed
|
||||
@@ -0,0 +1,14 @@
|
||||
---
|
||||
|
||||
- name: Remove basic server
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
check_mode: "{{ check_mode }}"
|
||||
netscaler_server:
|
||||
nitro_user: "{{nitro_user}}"
|
||||
nitro_pass: "{{nitro_pass}}"
|
||||
nsip: "{{nsip}}"
|
||||
|
||||
state: absent
|
||||
|
||||
name: test-server-ipv6
|
||||
@@ -0,0 +1,15 @@
|
||||
---
|
||||
|
||||
- name: Setup basic server
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
check_mode: "{{ check_mode }}"
|
||||
netscaler_server:
|
||||
nitro_user: "{{nitro_user}}"
|
||||
nitro_pass: "{{nitro_pass}}"
|
||||
nsip: "{{nsip}}"
|
||||
|
||||
state: present
|
||||
|
||||
name: test-server-ipv6
|
||||
ipaddress: ff::fa:0
|
||||
@@ -0,0 +1,15 @@
|
||||
---
|
||||
|
||||
- name: Setup basic server
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
check_mode: "{{ check_mode }}"
|
||||
netscaler_server:
|
||||
nitro_user: "{{nitro_user}}"
|
||||
nitro_pass: "{{nitro_pass}}"
|
||||
nsip: "{{nsip}}"
|
||||
|
||||
state: present
|
||||
|
||||
name: test-server-ipv6
|
||||
ipaddress: ff::fb:0
|
||||
Reference in New Issue
Block a user