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:
parent
e55d16a9be
commit
35a81cdd60
5 changed files with 21 additions and 9 deletions
|
@ -8,7 +8,7 @@
|
|||
- name: deploy grafana-kiosk config
|
||||
become: true
|
||||
template:
|
||||
src: templates/config.yml
|
||||
src: templates/config.yml.j2
|
||||
dest: /etc/grafana-kiosk/config.yml
|
||||
mode: 0644
|
||||
backup: true
|
||||
|
@ -17,9 +17,19 @@
|
|||
- name: deploy systemd file
|
||||
become: true
|
||||
template:
|
||||
src: templates/grafana-kiosk.service
|
||||
src: templates/grafana-kiosk.service.j2
|
||||
dest: /etc/systemd/system/grafana-kiosk.service
|
||||
mode: 0664
|
||||
owner: root
|
||||
group: root
|
||||
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
|
||||
|
||||
|
|
3
templates/grafana-kiosk.env.j2
Normal file
3
templates/grafana-kiosk.env.j2
Normal file
|
@ -0,0 +1,3 @@
|
|||
#!/bin/bash
|
||||
export {{ grafana_kiosk.display }}
|
||||
export XAUTHORITY=/home/{{ grafana_kiosk.user }}/.Xauthority
|
|
@ -9,13 +9,12 @@ User={{ grafana_kiosk.user }}
|
|||
Restart = always
|
||||
RestartSec=5s
|
||||
Type=simple
|
||||
Environment="{{ grafana_kiosk.display }}"
|
||||
Environment="XAUTHORITY=/home/{{ grafana_kiosk.user }}/.Xauthority"
|
||||
ExecStart=
|
||||
EnvironmentFile=/home/{{ grafana_kiosk.user }}/.grafana-kiosk.env
|
||||
ExecStart=/bin/bash -c "
|
||||
{%- if not grafana_kiosk.general.autofit | bool -%}
|
||||
KIOSK_AUTOFIT={{ grafana_kiosk.general.autofit | ternary("true", "false") }}{{ ' ' }}
|
||||
{%- endif -%}
|
||||
/usr/bin/grafana-kiosk -c /etc/grafana-kiosk/config.yml
|
||||
KIOSK_AUTOFIT={{ grafana_kiosk.general.autofit | ternary("true", "false") }}{{ '; '}}
|
||||
{%- endif -%}
|
||||
/usr/bin/grafana-kiosk -c /etc/grafana-kiosk/config.yml"
|
||||
|
||||
[Install]
|
||||
WantedBy=graphical.target
|
|
@ -32,5 +32,5 @@ _dl_matrix:
|
|||
'armv6l': "grafana-kiosk.linux.armv6"
|
||||
'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
|
||||
|
|
Loading…
Reference in a new issue