From b5577e4e1cbc0d18f1aa9fab4d9f2a0b8e4e7435 Mon Sep 17 00:00:00 2001 From: Daniel Hoffend Date: Tue, 30 Apr 2024 12:15:59 +0200 Subject: [PATCH 1/2] Set umask when installing plugins Otherwise system defaults could make the plugin unaccessible for the grafana user. Fixes #361 --- plugins/modules/grafana_plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/modules/grafana_plugin.py b/plugins/modules/grafana_plugin.py index c510f02b..db1e8553 100644 --- a/plugins/modules/grafana_plugin.py +++ b/plugins/modules/grafana_plugin.py @@ -223,7 +223,7 @@ def grafana_plugin(module, params): else: cmd = "{0} uninstall {1}".format(grafana_cli, params["name"]) - rc, stdout, stderr = module.run_command(cmd) + rc, stdout, stderr = module.run_command(cmd, umask=0o0022) if rc == 0: stdout_lines = stdout.split("\n") for line in stdout_lines: From 3c0586559798922098775842ff2fd5993bffc212 Mon Sep 17 00:00:00 2001 From: Nemental <15136847+Nemental@users.noreply.github.com> Date: Thu, 2 May 2024 09:23:38 +0200 Subject: [PATCH 2/2] docs: changelog fragment --- changelogs/fragments/362-plugin-umask.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 changelogs/fragments/362-plugin-umask.yml diff --git a/changelogs/fragments/362-plugin-umask.yml b/changelogs/fragments/362-plugin-umask.yml new file mode 100644 index 00000000..cbef21ff --- /dev/null +++ b/changelogs/fragments/362-plugin-umask.yml @@ -0,0 +1,2 @@ +bugfixes: + - Set umask for `grafana_plugin` command