nxos_logging message fix (#49205)

* nxos_logging message fix

* Remove rescue in block
This commit is contained in:
Mike Wiebe 2018-11-28 00:07:04 -05:00 committed by Trishna Guha
commit 374ca783bb
3 changed files with 28 additions and 9 deletions

View file

@ -1,3 +1,13 @@
---
- { include: cli.yaml, tags: ['cli'] }
- { include: nxapi.yaml, tags: ['nxapi'] }
# Use block to ensure that the baude rate gets set
# back to 9600 even if there are failures or errors.
- block:
- { include: cli.yaml, tags: ['cli'] }
- { include: nxapi.yaml, tags: ['nxapi'] }
always:
- name: Set Baud Rate Back to 9600 so our tests don't break
nxos_config:
lines:
- speed 9600
parents: line console
connection: network_cli

View file

@ -3,6 +3,15 @@
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
# This task is needed to clear out any previous logfile
# size settings.
- name: Workaround to clear logging logfile size
nxos_config:
lines:
- logging logfile test 1 size 4194304
provider: "{{ connection }}"
ignore_errors: yes
- name: Purge logging configuration first
nxos_logging:
purge: true
@ -51,7 +60,7 @@
- name: Set Baud Rate to less than 38400
nxos_config:
lines:
- speed 9600
- speed 19200
parents: line console
provider: "{{ connection }}"
@ -263,7 +272,7 @@
- block:
- name: Configure Logging message
nxos_logging: &logm
message: add-interface-description
interface_message: add-interface-description
state: present
provider: "{{ connection }}"
register: result
@ -280,7 +289,7 @@
- name: Remove Logging message
nxos_logging:
message: add-interface-description
interface_message: add-interface-description
state: absent
provider: "{{ connection }}"
register: result