From 24e6a6ced0b904eb87e2927029ee8834221799e1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20Nasiadka?= <mnasiadka@gmail.com>
Date: Tue, 7 Sep 2021 09:40:43 +0200
Subject: [PATCH] toolbox: Allow different users logging to ansible.log

Currently only operations done with default kolla_toolbox user are logged
to /var/log/kolla/ansible.log.

In order to fix logging, permissions to ansible.log must allow writing
for other users in kolla group - and then a separate patch will follow
to make custom ansible.cfg file usable by other toolbox users.

Partial-Bug: #1942846
Change-Id: I1be60ac7647b1a838e97f05f15ba5f0e39e8ae3c
---
 ansible/roles/common/templates/kolla-toolbox.json.j2 | 3 ++-
 releasenotes/notes/bug-1942846-8b9edb99a7e7c24f.yaml | 5 +++++
 2 files changed, 7 insertions(+), 1 deletion(-)
 create mode 100644 releasenotes/notes/bug-1942846-8b9edb99a7e7c24f.yaml

diff --git a/ansible/roles/common/templates/kolla-toolbox.json.j2 b/ansible/roles/common/templates/kolla-toolbox.json.j2
index 79c69e92f3..1b3b06f1cb 100644
--- a/ansible/roles/common/templates/kolla-toolbox.json.j2
+++ b/ansible/roles/common/templates/kolla-toolbox.json.j2
@@ -23,7 +23,8 @@
     "permissions": [
         {
             "path": "/var/log/kolla/ansible.log",
-            "owner": "ansible:ansible"
+            "perm": "0664",
+            "owner": "ansible:kolla"
         }
     ]
 }
diff --git a/releasenotes/notes/bug-1942846-8b9edb99a7e7c24f.yaml b/releasenotes/notes/bug-1942846-8b9edb99a7e7c24f.yaml
new file mode 100644
index 0000000000..588af50d55
--- /dev/null
+++ b/releasenotes/notes/bug-1942846-8b9edb99a7e7c24f.yaml
@@ -0,0 +1,5 @@
+---
+fixes:
+  - |
+    Fixes kolla-toolbox ansible.log logging for different users than ansible.
+    `LP#1942846 <https://launchpad.net/bugs/1942846>`__