Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFE] refactor logging of network module #29

Closed
thom311 opened this issue Mar 7, 2018 · 2 comments · Fixed by #207
Closed

[RFE] refactor logging of network module #29

thom311 opened this issue Mar 7, 2018 · 2 comments · Fixed by #207
Labels
blocker Issue to fix for next release enhancement Request for Enhancement help wanted Possible issue for newcomers

Comments

@thom311
Copy link
Contributor

thom311 commented Mar 7, 2018

Currently, the module collects all logging statements, and at the end returns them as "warnings", so that they are shown by ansible. Obviously, these are not really warnings, but rather debug information.

Instead, the logging messages should be returned in a different json field that is ignored by ansible. Then, the tasks/main.yml should have a follow-up debug task that prints the returned variable.

I guess, in the failure case, the network_connections task must run ignoring failures to reach the debug statement. Then, a follow up task should check whether the network_connections task failed and abort.

@thom311 thom311 changed the title [REF] refactor logging of network module [RFE] refactor logging of network module Mar 7, 2018
@tyll tyll added enhancement Request for Enhancement help wanted Possible issue for newcomers labels Apr 20, 2020
@tyll
Copy link
Member

tyll commented Apr 20, 2020

Ansible now supports blocks and the messages could be shown in the rescue or always part in case of failures. Reference: https://docs.ansible.com/ansible/latest/user_guide/playbooks_blocks.html

@tyll tyll added the blocker Issue to fix for next release label Apr 20, 2020
@tyll
Copy link
Member

tyll commented Apr 20, 2020

Actually in case of a failure, the module can just output the logs as warnings as currently in addition to putting them into a different json field. No need for a rescue block IMHO. The debug statement might be nice nonetheless.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker Issue to fix for next release enhancement Request for Enhancement help wanted Possible issue for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants