ansible/test/integration/targets/nxos_nxapi/tests/cli/configure.yaml
nkshrishail 01e4c41be4 nxos: Removing local-nxapi plugin and related parameters' usage from the integration tests. (#65068)
* nxos_integration_tests: Removing obsolete provider parameter

* nxos: removing support for local-nxapi plugin

* nxos: removing LocalNxapi plugin implementation

* nxos_nxapi: removing local plugin usage

* REVERT - nxos: removing LocalNxapi plugin implementation

* Addressing yamllint issues

* Removing the condition on the debug messages

* Restoring changes done to nxos_nxapi* tests

* Retaining timeout of 500 on nxos_smoke test

* Some cleanup

* Addressing latest comments

* Restoring the nxos_smoke and removing timeout from nxos_config and nxos_rollback
2020-01-08 13:43:23 +05:30

141 lines
3.6 KiB
YAML

---
- debug: msg="START cli/configure.yaml"
- set_fact: nxapi_sandbox_option="yes"
when: platform is search('N7K')
- name: Setup - put NXAPI in stopped state
nxos_nxapi:
state: absent
- block:
- name: Configure NXAPI HTTPS
nxos_nxapi: &configure_https
enable_http: no
enable_sandbox: "{{nxapi_sandbox_option|default(omit)}}"
enable_https: yes
https_port: 9443
register: result
- nxos_command:
commands:
- show nxapi | json
register: result
- include: tasks/platform/n7k/assert_changes_https.yaml
when: platform is match('N7K')
- include: tasks/platform/n5k/assert_changes_https.yaml
when: platform is search('N5K|N6K')
- include: tasks/platform/default/assert_changes_https.yaml
when: platform is not search('N35|N5K|N6K|N7K')
- name: Configure NXAPI HTTPS again
nxos_nxapi: *configure_https
register: result
- name: Assert configuration is idempotent
assert: &assert_false
that:
- result.changed == false
- name: Configure NXAPI HTTPS & HTTP
nxos_nxapi: &configure_https_http
enable_http: yes
enable_sandbox: "{{nxapi_sandbox_option|default(omit)}}"
enable_https: yes
https_port: 9443
register: result
- nxos_command:
commands:
- show nxapi | json
register: result
- include: tasks/platform/n7k/assert_changes_https_http.yaml
when: platform is match('N7K')
- include: tasks/platform/n5k/assert_changes_https_http.yaml
when: platform is match('N5K')
- include: tasks/platform/default/assert_changes_https_http.yaml
when: platform is not search('N35|N5K|N6K|N7K')
- name: Configure NXAPI HTTPS & HTTP again
nxos_nxapi: *configure_https_http
register: result
- name: Assert configuration is idempotent
assert: *assert_false
- name: Configure different NXAPI HTTPS & HTTP ports
nxos_nxapi: &configure_https_http_ports
enable_http: yes
enable_sandbox: "{{nxapi_sandbox_option|default(omit)}}"
enable_https: yes
http_port: 99
https_port: 500
register: result
- nxos_command:
commands:
- show nxapi | json
register: result
- include: tasks/platform/n7k/assert_changes_https_http_ports.yaml
when: platform is match('N7K')
- include: tasks/platform/n5k/assert_changes_https_http_ports.yaml
when: platform is match('N5K')
- include: tasks/platform/default/assert_changes_https_http_ports.yaml
when: platform is not search('N35|N5K|N6K|N7K')
- name: Configure different NXAPI HTTPS & HTTP ports again
nxos_nxapi: *configure_https_http_ports
register: result
- name: Assert configuration is idempotent
assert: *assert_false
- name: Configure NXAPI HTTP
nxos_nxapi: &configure_http
enable_http: yes
enable_sandbox: "{{nxapi_sandbox_option|default(omit)}}"
enable_https: no
register: result
- nxos_command:
commands:
- show nxapi | json
register: result
- include: tasks/platform/n7k/assert_changes_http.yaml
when: platform is match('N7K')
- include: tasks/platform/n5k/assert_changes_http.yaml
when: platform is match('N5K')
- include: tasks/platform/default/assert_changes_http.yaml
when: platform is not search('N35|N5K|N6K|N7K')
- name: Configure NXAPI HTTP again
nxos_nxapi: *configure_http
register: result
- name: Assert configuration is idempotent
assert: *assert_false
always:
- name: Cleanup - Disable NXAPI
nxos_nxapi:
state: absent
register: result
- name: Cleanup - Re-enable NXAPI
nxos_nxapi:
state: present
register: result
- debug: msg="END cli/configure.yaml"