ansible/test/integration/targets/nxos_config/tests/common/src_basic.yaml
Chris Van Heuveln d69239c440 network.py:ActionModule:run: does not honor _handle_src_option failures (#52745)
* network.py:ActionModule:run: does not honor _handle_src_option failures

PR #50301 moved template error handling out of run() and into its
own method in `_handle_src_option`; however, after the change run()
ignores the return value so any errors are ignored.

Reproduceable with `nxos_config/tests/common/src_invalid.yaml`

Verified fix with `nxos_config/tests/common/src_*` tests.

Ref:
71113ee291 (diff-7477bf046013758366cc85b06f90709aR43)

* nxos_config/tests/common/src_basic: Updated to test with src

This test was not actually testing with `src:` as it should have.

* Revert 412d7e change to plugins/action/network.py

PR #52912 fixed this already.

* nxos_config: fix src_invalid test
2019-02-28 11:07:03 +05:30

41 lines
966 B
YAML

---
- debug: msg="START common/src_basic.yaml on connection={{ ansible_connection }}"
- set_fact: intname="loopback1"
- name: setup
nxos_config:
commands:
- no description
- no shutdown
parents:
- "interface {{ intname }}"
match: none
provider: "{{ connection }}"
- name: configure device with config
nxos_config:
src: basic/config.j2
provider: "{{ connection }}"
defaults: yes
register: result
- assert:
that:
- "result.changed == true"
# https://github.com/ansible/ansible-modules-core/issues/4807
- "result.updates is defined"
- name: check device with config
nxos_config:
src: basic/config.j2
provider: "{{ connection }}"
register: result
- assert:
that:
- "result.changed == false"
# https://github.com/ansible/ansible-modules-core/issues/4807
- "result.updates is not defined"
- debug: msg="END common/src_basic.yaml on connection={{ ansible_connection }}"