[ADD] Allows remote browse refresh

This commit is contained in:
Jorge Enrique Gómez Gómez 2022-07-09 22:26:37 -05:00
parent 1c876b1d98
commit 574941cde5
5 changed files with 102 additions and 52 deletions

View 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

View 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

View 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

View 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

View File

@ -16,57 +16,7 @@
shell: /usr/bin/bash
password: '!'
- name: Setup silent login for user odoo
file:
path: /home/odoo/.hushlogin
state: touch
mode: 0644
owner: odoo
- import_tasks: autologin_odoo_user.yml
- 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: 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
- import_tasks: allow_remote_page_refresh.yml