Creates a role to install the display

This commit is contained in:
Jorge Enrique Gómez Gómez 2022-07-09 15:21:17 -05:00
parent 466f19bf7c
commit 4cc3fdb769
8 changed files with 115 additions and 0 deletions

1
hosts Normal file
View File

@ -0,0 +1 @@
localhost ansible_connection=local

8
local.yml Normal file
View File

@ -0,0 +1,8 @@
---
- hosts: localhost
gather_facts: yes
user: root
roles:
- display

View File

@ -0,0 +1 @@
[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && startx -- -nocursor

View File

@ -0,0 +1 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJFzc7gcnNd3n/g885DEDHDOQMazi93I1MZak7IV6xZ/ odoo@erpserver

View File

@ -0,0 +1,4 @@
[Service]
ExecStart=
ExecStart=-/sbin/agetty --noissue --autologin odoo --noclear %I $TERM

View File

@ -0,0 +1,71 @@
---
- name: Install required packages
apt:
update_cache: yes
pkg: '{{ required_packages }}'
- name: Create the odoo user
user:
name: odoo
uid: 1001
home: /home/odoo
group: users
groups:
- video
shell: /usr/bin/bash
- 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: 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

View File

@ -0,0 +1,16 @@
# Disable any form of screen saver / screen blanking / power management
xset s off
xset s noblank
xset -dpms
# Allow quitting the X server with CTRL-ATL-Backspace
setxkbmap -option terminate:ctrl_alt_bksp
# Start Chromium in kiosk mode
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' \
~/snap/chromium/common/chromium/Local\ State
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/; s/"exit_type":"[^"]\+"/"exit_type":"Normal"/' \
~/snap/chromium/common/chromium/Default/Preferences
chromium-browser --disable-infobars --kiosk '{{ kiosk_url }}'

View File

@ -0,0 +1,13 @@
---
required_packages:
- xserver-xorg
- xserver-xorg-video-fbdev
- x11-xserver-utils
- xinit
- xdotool
- openbox
- chromium-browser
kiosk_url: 'https://erp.agofer.com/web#action=1013&model=stock.delivery&view_type=kanban&cids=1&menu_id=736'