diff --git a/tests/integration/targets/lbvserver_servicegroup_binding/aliases b/tests/integration/targets/lbvserver_servicegroup_binding/aliases new file mode 100644 index 000000000..28a231e46 --- /dev/null +++ b/tests/integration/targets/lbvserver_servicegroup_binding/aliases @@ -0,0 +1,3 @@ +gather_facts/no +netscaler/cpx/ +netscaler/vpx/ diff --git a/tests/integration/targets/lbvserver_servicegroup_binding/tasks/main.yaml b/tests/integration/targets/lbvserver_servicegroup_binding/tasks/main.yaml new file mode 100644 index 000000000..3a7e81156 --- /dev/null +++ b/tests/integration/targets/lbvserver_servicegroup_binding/tasks/main.yaml @@ -0,0 +1,135 @@ +--- +- name: Include prerequisite tasks + ansible.builtin.include_tasks: setup.yaml +- name: LBVSERVER_SERVICEGROUP_BINDING | ADD | --check + delegate_to: localhost + register: result + check_mode: true + tags: test + netscaler.adc.lbvserver_servicegroup_binding: + nsip: "{{ nsip }}" + nitro_user: "{{ nitro_user }}" + nitro_pass: "{{ nitro_pass }}" + nitro_protocol: "{{ nitro_protocol }}" + validate_certs: "{{ validate_certs }}" + save_config: "{{ save_config }}" + state: present + weight: 1 + name: "{{ lb_name }}" + servicename: "{{ servicegroup_name }}" +- name: Assert | LBVSERVER_SERVICEGROUP_BINDING | ADD | --check + tags: test + ansible.builtin.assert: + that: + - "result.failed==false" + - "result.changed==true" +- name: LBVSERVER_SERVICEGROUP_BINDING | ADD + delegate_to: localhost + register: result + check_mode: false + tags: test + netscaler.adc.lbvserver_servicegroup_binding: + nsip: "{{ nsip }}" + nitro_user: "{{ nitro_user }}" + nitro_pass: "{{ nitro_pass }}" + nitro_protocol: "{{ nitro_protocol }}" + validate_certs: "{{ validate_certs }}" + save_config: "{{ save_config }}" + state: present + weight: 1 + name: "{{ lb_name }}" + servicename: "{{ servicegroup_name }}" +- name: Assert | LBVSERVER_SERVICEGROUP_BINDING | ADD + ansible.builtin.assert: + that: + - "result.failed==false" + - "result.changed==true" +- name: LBVSERVER_SERVICEGROUP_BINDING | ADD | idempotent + delegate_to: localhost + register: result + check_mode: false + tags: test + netscaler.adc.lbvserver_servicegroup_binding: + nsip: "{{ nsip }}" + nitro_user: "{{ nitro_user }}" + nitro_pass: "{{ nitro_pass }}" + nitro_protocol: "{{ nitro_protocol }}" + validate_certs: "{{ validate_certs }}" + save_config: "{{ save_config }}" + state: present + weight: 1 + name: "{{ lb_name }}" + servicename: "{{ servicegroup_name }}" +- name: Assert | LBVSERVER_SERVICEGROUP_BINDING | ADD | idempotent + tags: test + ansible.builtin.assert: + that: + - "result.failed==false" + - "result.changed==true" +- name: LBVSERVER_SERVICEGROUP_BINDING | DELETE | --check + delegate_to: localhost + register: result + check_mode: true + tags: test + netscaler.adc.lbvserver_servicegroup_binding: + nsip: "{{ nsip }}" + nitro_user: "{{ nitro_user }}" + nitro_pass: "{{ nitro_pass }}" + nitro_protocol: "{{ nitro_protocol }}" + validate_certs: "{{ validate_certs }}" + save_config: "{{ save_config }}" + state: absent + weight: 1 + name: "{{ lb_name }}" + servicename: "{{ servicegroup_name }}" +- name: Assert | LBVSERVER_SERVICEGROUP_BINDING | DELETE | --check + tags: test + ansible.builtin.assert: + that: + - "result.failed==false" + - "result.changed==true" +- name: LBVSERVER_SERVICEGROUP_BINDING | DELETE + delegate_to: localhost + register: result + check_mode: false + tags: test + netscaler.adc.lbvserver_servicegroup_binding: + nsip: "{{ nsip }}" + nitro_user: "{{ nitro_user }}" + nitro_pass: "{{ nitro_pass }}" + nitro_protocol: "{{ nitro_protocol }}" + validate_certs: "{{ validate_certs }}" + save_config: "{{ save_config }}" + state: absent + weight: 1 + name: "{{ lb_name }}" + servicename: "{{ servicegroup_name }}" +- name: Assert | LBVSERVER_SERVICEGROUP_BINDING | DELETE + ansible.builtin.assert: + that: + - "result.failed==false" + - "result.changed==true" +- name: LBVSERVER_SERVICEGROUP_BINDING | DELETE | idempotent + delegate_to: localhost + register: result + check_mode: false + tags: test + netscaler.adc.lbvserver_servicegroup_binding: + nsip: "{{ nsip }}" + nitro_user: "{{ nitro_user }}" + nitro_pass: "{{ nitro_pass }}" + nitro_protocol: "{{ nitro_protocol }}" + validate_certs: "{{ validate_certs }}" + save_config: "{{ save_config }}" + state: absent + weight: 1 + name: "{{ lb_name }}" + servicename: "{{ servicegroup_name }}" +- name: Assert | LBVSERVER_SERVICEGROUP_BINDING | DELETE | idempotent + tags: test + ansible.builtin.assert: + that: + - "result.failed==false" + - "result.changed==false" +- name: Include prerequisite tasks + ansible.builtin.include_tasks: teardown.yaml diff --git a/tests/integration/targets/lbvserver_servicegroup_binding/tasks/setup.yaml b/tests/integration/targets/lbvserver_servicegroup_binding/tasks/setup.yaml new file mode 100644 index 000000000..37d2db0da --- /dev/null +++ b/tests/integration/targets/lbvserver_servicegroup_binding/tasks/setup.yaml @@ -0,0 +1,25 @@ +--- +- name: Create a lb + delegate_to: localhost + netscaler.adc.lbvserver: + nsip: "{{ nsip }}" + nitro_user: "{{ nitro_user }}" + nitro_pass: "{{ nitro_pass }}" + nitro_protocol: "{{ nitro_protocol }}" + validate_certs: "{{ validate_certs }}" + save_config: "{{ save_config }}" + state: present + name: "{{ lb_name }}" + servicetype: SSL +- name: Create a servicegroup + delegate_to: localhost + netscaler.adc.servicegroup: + nsip: "{{ nsip }}" + nitro_user: "{{ nitro_user }}" + nitro_pass: "{{ nitro_pass }}" + nitro_protocol: "{{ nitro_protocol }}" + validate_certs: "{{ validate_certs }}" + save_config: "{{ save_config }}" + state: present + servicegroupname: "{{ servicegroup_name }}" + servicetype: SSL diff --git a/tests/integration/targets/lbvserver_servicegroup_binding/tasks/teardown.yaml b/tests/integration/targets/lbvserver_servicegroup_binding/tasks/teardown.yaml new file mode 100644 index 000000000..a71473879 --- /dev/null +++ b/tests/integration/targets/lbvserver_servicegroup_binding/tasks/teardown.yaml @@ -0,0 +1,25 @@ +--- +- name: Create a servicegroup + delegate_to: localhost + netscaler.adc.servicegroup: + nsip: "{{ nsip }}" + nitro_user: "{{ nitro_user }}" + nitro_pass: "{{ nitro_pass }}" + nitro_protocol: "{{ nitro_protocol }}" + validate_certs: "{{ validate_certs }}" + save_config: "{{ save_config }}" + state: absent + servicegroupname: "{{ servicegroup_name }}" + servicetype: SSL +- name: Create a lb + delegate_to: localhost + netscaler.adc.lbvserver: + nsip: "{{ nsip }}" + nitro_user: "{{ nitro_user }}" + nitro_pass: "{{ nitro_pass }}" + nitro_protocol: "{{ nitro_protocol }}" + validate_certs: "{{ validate_certs }}" + save_config: "{{ save_config }}" + state: absent + name: "{{ lb_name }}" + servicetype: SSL diff --git a/tests/integration/targets/lbvserver_servicegroup_binding/vars/main.yaml b/tests/integration/targets/lbvserver_servicegroup_binding/vars/main.yaml new file mode 100644 index 000000000..247d17426 --- /dev/null +++ b/tests/integration/targets/lbvserver_servicegroup_binding/vars/main.yaml @@ -0,0 +1,3 @@ +--- +lb_name: test_lb +servicegroup_name: test_sg