1
0
Fork 0
mirror of https://github.com/roles-ansible/role-grafana-kiosk.git synced 2024-08-16 10:09:49 +02:00

change to use enviroment file

and use a workaround for https://github.com/grafana/grafana-kiosk/issues/40
This commit is contained in:
L3D 2020-07-02 15:23:14 +02:00 committed by L3D
parent e55d16a9be
commit 35a81cdd60
No known key found for this signature in database
GPG key ID: 5215C3441797AB2B
5 changed files with 21 additions and 9 deletions

View file

@ -8,7 +8,7 @@
- name: deploy grafana-kiosk config - name: deploy grafana-kiosk config
become: true become: true
template: template:
src: templates/config.yml src: templates/config.yml.j2
dest: /etc/grafana-kiosk/config.yml dest: /etc/grafana-kiosk/config.yml
mode: 0644 mode: 0644
backup: true backup: true
@ -17,9 +17,19 @@
- name: deploy systemd file - name: deploy systemd file
become: true become: true
template: template:
src: templates/grafana-kiosk.service src: templates/grafana-kiosk.service.j2
dest: /etc/systemd/system/grafana-kiosk.service dest: /etc/systemd/system/grafana-kiosk.service
mode: 0664 mode: 0664
owner: root owner: root
group: root group: root
notify: systemctl restart grafana-kiosk.service notify: systemctl restart grafana-kiosk.service
- name: deploy env vars
become: true
template:
src: templates/grafana-kiosk.env.j2
dest: "/home/{{ grafana_kiosk.user }}/.grafana-kiosk.env"
mode: 0755
owner: "{{ grafana_kiosk.user }}"
notify: systemctl restart grafana-kiosk.service

View file

@ -0,0 +1,3 @@
#!/bin/bash
export {{ grafana_kiosk.display }}
export XAUTHORITY=/home/{{ grafana_kiosk.user }}/.Xauthority

View file

@ -9,13 +9,12 @@ User={{ grafana_kiosk.user }}
Restart = always Restart = always
RestartSec=5s RestartSec=5s
Type=simple Type=simple
Environment="{{ grafana_kiosk.display }}" EnvironmentFile=/home/{{ grafana_kiosk.user }}/.grafana-kiosk.env
Environment="XAUTHORITY=/home/{{ grafana_kiosk.user }}/.Xauthority" ExecStart=/bin/bash -c "
ExecStart=
{%- if not grafana_kiosk.general.autofit | bool -%} {%- if not grafana_kiosk.general.autofit | bool -%}
KIOSK_AUTOFIT={{ grafana_kiosk.general.autofit | ternary("true", "false") }}{{ ' ' }} KIOSK_AUTOFIT={{ grafana_kiosk.general.autofit | ternary("true", "false") }}{{ '; '}}
{%- endif -%} {%- endif -%}
/usr/bin/grafana-kiosk -c /etc/grafana-kiosk/config.yml /usr/bin/grafana-kiosk -c /etc/grafana-kiosk/config.yml"
[Install] [Install]
WantedBy=graphical.target WantedBy=graphical.target

View file

@ -32,5 +32,5 @@ _dl_matrix:
'armv6l': "grafana-kiosk.linux.armv6" 'armv6l': "grafana-kiosk.linux.armv6"
'armv5l': "grafana-kiosk.linux.armv5" 'armv5l': "grafana-kiosk.linux.armv5"
playbook_version_number: 13 # should be an integer playbook_version_number: 14 # should be an integer
playbook_version_path: 'role-grafana-kiosk_roles-ansible_github.com.version' # unique string playbook_version_path: 'role-grafana-kiosk_roles-ansible_github.com.version' # unique string