2016-10-28 18:50:29 +00:00
|
|
|
---
|
|
|
|
- debug: msg="START cli/configure.yaml"
|
|
|
|
|
2017-08-28 19:00:56 +00:00
|
|
|
- set_fact: nxapi_sandbox_option="yes"
|
2017-11-27 22:58:08 +00:00
|
|
|
when: platform is search('N7K')
|
2017-08-28 19:00:56 +00:00
|
|
|
|
2016-10-28 18:50:29 +00:00
|
|
|
- name: Setup - put NXAPI in stopped state
|
|
|
|
nxos_nxapi:
|
|
|
|
state: absent
|
|
|
|
provider: "{{ cli }}"
|
|
|
|
|
|
|
|
- name: Configure NXAPI
|
|
|
|
nxos_nxapi:
|
|
|
|
enable_http: no
|
2017-08-28 19:00:56 +00:00
|
|
|
enable_sandbox: "{{nxapi_sandbox_option|default(omit)}}"
|
2016-10-28 18:50:29 +00:00
|
|
|
enable_https: yes
|
|
|
|
https_port: 9443
|
|
|
|
provider: "{{ cli }}"
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- nxos_command:
|
|
|
|
commands:
|
|
|
|
- show nxapi | json
|
|
|
|
provider: "{{ cli }}"
|
|
|
|
register: result
|
|
|
|
|
2017-08-28 19:00:56 +00:00
|
|
|
- include: targets/nxos_nxapi/tasks/platform/n7k/assert_changes.yaml
|
2017-11-27 22:58:08 +00:00
|
|
|
when: platform is match('N7K')
|
2017-08-28 19:00:56 +00:00
|
|
|
|
|
|
|
- include: targets/nxos_nxapi/tasks/platform/default/assert_changes.yaml
|
2017-11-27 22:58:08 +00:00
|
|
|
when: not ( platform is search('N7K'))
|
2016-10-28 18:50:29 +00:00
|
|
|
|
|
|
|
- name: Configure NXAPI again
|
|
|
|
nxos_nxapi:
|
|
|
|
enable_http: no
|
2017-08-28 19:00:56 +00:00
|
|
|
enable_sandbox: "{{nxapi_sandbox_option|default(omit)}}"
|
2016-10-28 18:50:29 +00:00
|
|
|
enable_https: yes
|
|
|
|
https_port: 9443
|
|
|
|
provider: "{{ cli }}"
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- name: Assert configuration is idempotent
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- result.changed == false
|
|
|
|
|
|
|
|
- debug: msg="END cli/configure.yaml"
|