ansible-collections / community.grafana

Grafana Collection for Ansible
http://galaxy.ansible.com/community/grafana
GNU General Public License v3.0
129 stars 82 forks source link

Plugin not usable when system umask is set to umask 027 #361

Closed dhoffend closed 5 months ago

dhoffend commented 5 months ago
SUMMARY

When the systems default UMASK is set to 027 in /etc/login.defs the installation of plugins will be unaccessible by the grafana user.

Since all files are owned by root:root and the umask of the folders ist 0750 the plugin isn't availble in grafana. Maybe it would be useful to set/execute umask 022; before executing the grafana-cli plugin install command.

ISSUE TYPE
COMPONENT NAME

community.grafana.grafana_plugin

ANSIBLE VERSION

not relevant

COLLECTION VERSION

v1.8.0

STEPS TO REPRODUCE
# Part of your os / hardinging procecure, not part grafana/appllication playbook)
- ansible.builtin.lineinfile:
    dest: /etc/login.defs
    line: UMASK 027
    regexp: ^UMASK.*

# Part of your grafana/app installation playbook
- community.grafana.grafana_plugin:
    name: grafana-image-renderer
EXPECTED RESULTS

Folder and files should be 0755 or 0644 and not unaccessible

ACTUAL RESULTS
root@hostname:/var/lib/grafana/plugins# ls -la
total 16
drwxr-xr-x 4 grafana grafana 4096 Apr 30 10:43 .
drwxr-xr-x 7 grafana grafana 4096 Apr 26 19:20 ..
drwxr-x--- 4 root    root    4096 Apr 30 10:43 grafana-image-renderer