Bug 1574336 - Ansible logging improvements
Summary: Ansible logging improvements
Alias: None
Product: ovirt-hosted-engine-setup
Classification: oVirt
Component: General
Version: 2.2.1
Hardware: Unspecified
OS: Unspecified
Target Milestone: ovirt-4.2.5
: 2.2.23
Assignee: Ido Rosenzwig
QA Contact: Nikolai Sednev
Depends On:
Blocks: ovirt-hosted-engine-setup-2.2.24
TreeView+ depends on / blocked
Reported: 2018-05-03 05:32 UTC by Yedidyah Bar David
Modified: 2018-07-31 15:26 UTC (History)
4 users (show)

Fixed In Version: ovirt-hosted-engine-setup-2.2.23-1.el7ev
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2018-07-31 15:26:48 UTC
oVirt Team: Integration
nsednev: needinfo-
rule-engine: ovirt-4.2+

Attachments (Terms of Use)
bootstrap_vm_local.log - without the patch (2.50 MB, text/plain)
2018-06-20 12:37 UTC, Ido Rosenzwig
no flags Details
bootstrap_vm_local.log - with the patch (227.92 KB, text/plain)
2018-06-20 12:38 UTC, Ido Rosenzwig
no flags Details

System ID Private Priority Status Summary Last Updated
oVirt gerrit 92271 0 master MERGED Ansible: Improve logging 2018-09-03 09:32:34 UTC
oVirt gerrit 92398 0 ovirt-hosted-engine-setup-2.2 MERGED Ansible: Improve logging 2018-06-20 14:28:34 UTC

Description Yedidyah Bar David 2018-05-03 05:32:49 UTC
Description of problem:

In bug 1540850 we did some enhancements to logging, which we considered mandatory/urgent.

Opening this bug to collect less urgent improvements we probably want.

For now, this includes:

- Perhaps log somehow the module name of each task.

- Do not log doc strings of attributes.

- Do not log changes to the variables 'hostvars' and 'vars', after making sure they are indeed always redundant.

Comment 1 Ido Rosenzwig 2018-06-20 12:37:46 UTC
Created attachment 1453208 [details]
bootstrap_vm_local.log - without the patch

Comment 2 Ido Rosenzwig 2018-06-20 12:38:46 UTC
Created attachment 1453210 [details]
bootstrap_vm_local.log - with the patch

Comment 3 Nikolai Sednev 2018-07-08 10:44:01 UTC
Whats the reproduction steps Yedidyah?

Comment 4 Nikolai Sednev 2018-07-08 14:42:33 UTC
Forth to our conversation with Ido, and to latest fix, moving this bug to verified as it works as expected now on these components:
Linux 3.10.0-862.6.3.el7.x86_64 #1 SMP Fri Jun 15 17:57:37 EDT 2018 x86_64 x86_64 x86_64 GNU/Linux
Red Hat Enterprise Linux Server release 7.5 (Maipo)

I see that logging is done in Json mode and much more structured that before:
2018-07-08 14:13:02,089+0300 DEBUG var changed: host "localhost" var "ansible_libvirt_networks" type "<type 'dict'>" value: "{
    "default": {
        "autostart": "yes", 
        "bridge": "virbr0", 
        "dhcp_leases": [], 
        "forward_mode": "nat", 
        "macaddress": "52:54:00:fb:ff:0e", 
        "persistent": "yes", 
        "state": "active", 
        "uuid": "041770be-b0d0-4f3e-9062-cac1c59f8c2f"
2018-07-08 14:13:02,090+0300 INFO ansible ok {'status': 'OK', 'ansible_task': u'Get libvirt interfaces', 'ansible_host': u'localhost', 'ansible_playbook': u'/usr/share/ovirt-hosted-engine-setup/ansible/bootstrap_local_vm.yml', 'ansible_type': 'task'}
2018-07-08 14:13:02,090+0300 DEBUG ansible on_any args <ansible.executor.task_result.TaskResult object at 0x7f9aebda8810> kwargs 
2018-07-08 14:13:02,673+0300 INFO ansible task start {'status': 'OK', 'ansible_task': u'Get routing rules', 'ansible_playbook': u'/usr/share/ovirt-hosted-engine-setup/ansible/bootstrap_local_vm.yml', 'ansible_type': 'task'}
2018-07-08 14:13:02,673+0300 DEBUG ansible on_any args TASK: Get routing rules kwargs is_conditional:False 
2018-07-08 14:13:03,906+0300 DEBUG var changed: host "localhost" var "route_rules" type "<type 'dict'>" value: "{
    "changed": true, 
    "cmd": [
    "delta": "0:00:00.084156", 
    "end": "2018-07-08 14:13:03.337497", 
    "failed": false, 
    "rc": 0, 
    "start": "2018-07-08 14:13:03.253341", 
    "stderr": "", 
    "stderr_lines": [], 
    "stdout": "0:\tfrom all lookup local \n32766:\tfrom all lookup main \n32767:\tfrom all lookup default ", 
    "stdout_lines": [
        "0:\tfrom all lookup local ", 
        "32766:\tfrom all lookup main ", 
        "32767:\tfrom all lookup default "


Comment 5 Sandro Bonazzola 2018-07-31 15:26:48 UTC
This bugzilla is included in oVirt 4.2.5 release, published on July 30th 2018.

Since the problem described in this bug report should be
resolved in oVirt 4.2.5 release, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.

Note You need to log in before you can comment on or make changes to this bug.