Bug 1899476

Summary: [RFE] Integrate ansible-role-collect-logs role with sosreport
Product: Red Hat OpenStack Reporter: Chandan Kumar <chkumar>
Component: ansible-role-collect-logsAssignee: shreshtha joshi <shrjoshi>
Status: CLOSED ERRATA QA Contact: Jon Schlueter <jschluet>
Severity: high Docs Contact:
Priority: high    
Version: 17.0 (Wallaby)CC: jjoyce, mariel, mburns, mgarciac, scohen, shrjoshi, whayutin
Target Milestone: AlphaKeywords: FutureFeature, Triaged
Target Release: 17.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ansible-role-collect-logs-1.2.0-0.20201127092921.188e42d.el8ost Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of:
: 1901845 (view as bug list) Environment:
Last Closed: 2022-09-21 12:12:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1901845    

Description Chandan Kumar 2020-11-19 11:03:11 UTC
ansible-role-collect-logs role - Ansible role for aggregating logs from different nodes.

Upstream url: https://opendev.org/openstack/ansible-role-collect-logs

RDO Packaging bug: https://bugzilla.redhat.com/show_bug.cgi?id=1897394 and patches for spec: https://review.rdoproject.org/r/#/q/topic:add-ansible-role-collect-logs+(status:open+OR+status:merged)

Goal: Currently sosreport is used to collect logs from different openstack deployed nodes.

In Upstream and infrared CI, we use the ansible-role-collect-logs ansible role to collect logs from different node and then visualize it by publishing on a file server.

In order to provider the same user experience for user and developers, we want to integrate collect-logs role with sosreport and then let sosreport calls the collect-logs role and run on different nodes.

Here is the implementation code:

++++++++++++++++++++++++++++++
diff --git a/sos/plugins/openstack_tripleo.py b/sos/plugins/openstack_tripleo.py
index 652d132f..858e8e2f 100644
--- a/sos/plugins/openstack_tripleo.py
+++ b/sos/plugins/openstack_tripleo.py
@@ -23,11 +23,9 @@ class OpenStackTripleO(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
     def setup(self):
         # Notes: recursion is max 2 for container-puppet and tripleo-config
         # Those directories are present on all OpenStack nodes
+        self.add_cmd_output(["""ansible -m include_role -a 'name=collect-logs' -e "artcl_collect_dir=/home/cloud-user/MY_LOGS" -e "undercloud_user='$(whoami)'" localhost"""])
         self.add_copy_spec([
-            '/var/log/paunch.log',
-            '/var/lib/container-puppet/',
-            '/var/lib/tripleo-config/',
-            '/etc/puppet/hieradata/'
+            '/home/cloud-user/MY_LOGS'
         ])

     def postproc(self):
@@ -38,9 +36,7 @@ class OpenStackTripleO(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
                   r'([":\s]+)(.*[^"])([",]+)'
         rgxp = re.compile(secrets, re.IGNORECASE)

-        self.do_path_regex_sub('/var/lib/tripleo-config/',
-                               rgxp, r'\1\3*********\5')
-        self.do_path_regex_sub('/etc/puppet/hieradata/',
+        self.do_path_regex_sub('/home/cloud-user/MY_LOGS',
                                rgxp, r'\1\3*********\5')

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

It is an RFE, once the package is available, we will couple it with sosreport and ship it to customers from RHOS-16.2 onwards.

Comment 4 David Vallee Delisle 2020-12-08 15:03:29 UTC
That would be great to add oslo-config-validator [1] within the scope of this playbook.

[1] https://docs.openstack.org/oslo.config/latest/cli/validator.html#comparing-configuration-with-the-default-configuration

Comment 11 Jon Schlueter 2022-08-03 18:06:25 UTC
build included in beta content

Comment 16 errata-xmlrpc 2022-09-21 12:12:17 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Release of components for Red Hat OpenStack Platform 17.0 (Wallaby)), and where to find the updated
files, follow the link below.

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

https://access.redhat.com/errata/RHEA-2022:6543