[ADD] Allows remote browse refresh
This commit is contained in:
parent
1c876b1d98
commit
574941cde5
10
roles/display/files/monitor_file_path_unit
Normal file
10
roles/display/files/monitor_file_path_unit
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Monitor file changes to refresh page
|
||||||
|
|
||||||
|
[Path]
|
||||||
|
PathChanged=/home/odoo/kiosk
|
||||||
|
Unit=monitor-kiosk-file.service
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
|
||||||
11
roles/display/files/monitor_file_service_unit
Normal file
11
roles/display/files/monitor_file_service_unit
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Reload page in running browser
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
Environment=DISPLAY=:0.0
|
||||||
|
Environment=XAUTHORITY=/home/odoo/.Xauthority
|
||||||
|
ExecStart=sh -c "xdotool keydown F5; xdotool keyup F5"
|
||||||
|
User=odoo
|
||||||
|
Group=users
|
||||||
|
|
||||||
29
roles/display/tasks/allow_remote_page_refresh.yml
Normal file
29
roles/display/tasks/allow_remote_page_refresh.yml
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
- name: Set authorized key with restrictions
|
||||||
|
authorized_key:
|
||||||
|
user: odoo
|
||||||
|
key: "{{ lookup('file', 'central_odoo_pubkey') }}"
|
||||||
|
key_options: 'command="/usr/bin/touch /home/odoo/kiosk",restrict'
|
||||||
|
|
||||||
|
- name: Service that monitors the file that Odoo uses for notification
|
||||||
|
copy:
|
||||||
|
src: monitor_file_path_unit
|
||||||
|
dest: /etc/systemd/system/monitor-kiosk-file.path
|
||||||
|
mode: 0644
|
||||||
|
owner: root
|
||||||
|
|
||||||
|
- name: Script that reloads the screen when it detects the file changed
|
||||||
|
copy:
|
||||||
|
src: monitor_file_service_unit
|
||||||
|
dest: /etc/systemd/system/monitor-kiosk-file.service
|
||||||
|
mode: 0644
|
||||||
|
owner: root
|
||||||
|
|
||||||
|
- name: Enable and start the path monitor
|
||||||
|
systemd:
|
||||||
|
daemon_reload: yes
|
||||||
|
name: monitor-kiosk-file.path
|
||||||
|
state: started
|
||||||
|
enabled: true
|
||||||
|
|
||||||
50
roles/display/tasks/autologin_odoo_user.yml
Normal file
50
roles/display/tasks/autologin_odoo_user.yml
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
- name: Setup silent login for user odoo
|
||||||
|
file:
|
||||||
|
path: /home/odoo/.hushlogin
|
||||||
|
state: touch
|
||||||
|
mode: 0644
|
||||||
|
owner: odoo
|
||||||
|
|
||||||
|
- name: Create openbox config dir
|
||||||
|
file:
|
||||||
|
path: /home/odoo/.config/openbox
|
||||||
|
state: directory
|
||||||
|
owner: odoo
|
||||||
|
mode: 0755
|
||||||
|
|
||||||
|
- name: Setup openbox autostart for user odoo
|
||||||
|
template:
|
||||||
|
src: autostart.j2
|
||||||
|
dest: /home/odoo/.config/openbox/autostart
|
||||||
|
mode: 0644
|
||||||
|
owner: odoo
|
||||||
|
|
||||||
|
- name: Start graphical screen when user logs in
|
||||||
|
copy:
|
||||||
|
src: bash_profile
|
||||||
|
dest: /home/odoo/.bash_profile
|
||||||
|
mode: 0644
|
||||||
|
owner: odoo
|
||||||
|
|
||||||
|
- name: Create autostart config dir
|
||||||
|
file:
|
||||||
|
path: /etc/systemd/system/getty@tty1.service.d
|
||||||
|
state: directory
|
||||||
|
owner: root
|
||||||
|
mode: 0755
|
||||||
|
|
||||||
|
- name: Login user odoo when system starts
|
||||||
|
copy:
|
||||||
|
src: tty_unit
|
||||||
|
dest: /etc/systemd/system/getty@tty1.service.d/override.conf
|
||||||
|
mode: 0644
|
||||||
|
owner: root
|
||||||
|
|
||||||
|
- name: Restart the login service
|
||||||
|
systemd:
|
||||||
|
daemon_reload: yes
|
||||||
|
name: getty@tty1
|
||||||
|
state: restarted
|
||||||
|
|
||||||
@ -16,57 +16,7 @@
|
|||||||
shell: /usr/bin/bash
|
shell: /usr/bin/bash
|
||||||
password: '!'
|
password: '!'
|
||||||
|
|
||||||
- name: Setup silent login for user odoo
|
- import_tasks: autologin_odoo_user.yml
|
||||||
file:
|
|
||||||
path: /home/odoo/.hushlogin
|
|
||||||
state: touch
|
|
||||||
mode: 0644
|
|
||||||
owner: odoo
|
|
||||||
|
|
||||||
- name: Create openbox config dir
|
- import_tasks: allow_remote_page_refresh.yml
|
||||||
file:
|
|
||||||
path: /home/odoo/.config/openbox
|
|
||||||
state: directory
|
|
||||||
owner: odoo
|
|
||||||
mode: 0755
|
|
||||||
|
|
||||||
- name: Setup openbox autostart for user odoo
|
|
||||||
template:
|
|
||||||
src: autostart.j2
|
|
||||||
dest: /home/odoo/.config/openbox/autostart
|
|
||||||
mode: 0644
|
|
||||||
owner: odoo
|
|
||||||
|
|
||||||
- name: Start graphical screen when user logs in
|
|
||||||
copy:
|
|
||||||
src: bash_profile
|
|
||||||
dest: /home/odoo/.bash_profile
|
|
||||||
mode: 0644
|
|
||||||
owner: odoo
|
|
||||||
|
|
||||||
- name: Set authorized key with restrictions
|
|
||||||
authorized_key:
|
|
||||||
user: odoo
|
|
||||||
key: "{{ lookup('file', 'central_odoo_pubkey') }}"
|
|
||||||
key_options: 'command="/usr/bin/touch /home/odoo/kiosk",restrict'
|
|
||||||
|
|
||||||
- name: Create autostart config dir
|
|
||||||
file:
|
|
||||||
path: /etc/systemd/system/getty@tty1.service.d
|
|
||||||
state: directory
|
|
||||||
owner: root
|
|
||||||
mode: 0755
|
|
||||||
|
|
||||||
- name: Login user odoo when system starts
|
|
||||||
copy:
|
|
||||||
src: tty_unit
|
|
||||||
dest: /etc/systemd/system/getty@tty1.service.d/override.conf
|
|
||||||
mode: 0644
|
|
||||||
owner: root
|
|
||||||
|
|
||||||
- name: Restart the login service
|
|
||||||
systemd:
|
|
||||||
daemon_reload: yes
|
|
||||||
name: getty@tty1
|
|
||||||
state: restarted
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user