Bug 1899476 - [RFE] Integrate ansible-role-collect-logs role with sosreport
Summary: [RFE] Integrate ansible-role-collect-logs role with sosreport
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: ansible-role-collect-logs
Version: 17.0 (Wallaby)
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: Alpha
: 17.0
Assignee: shreshtha joshi
QA Contact: Jon Schlueter
URL:
Whiteboard:
Depends On:
Blocks: 1901845
TreeView+ depends on / blocked
 
Reported: 2020-11-19 11:03 UTC by Chandan Kumar
Modified: 2023-02-22 23:02 UTC (History)
7 users (show)

Fixed In Version: ansible-role-collect-logs-1.2.0-0.20201127092921.188e42d.el8ost
Doc Type: No Doc Update
Doc Text:
Clone Of:
: 1901845 (view as bug list)
Environment:
Last Closed: 2022-09-21 12:12:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker OSP-5149 0 None None None 2022-02-16 18:39:18 UTC
Red Hat Product Errata RHEA-2022:6543 0 None None None 2022-09-21 12:13:30 UTC

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


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