Initial Commit

master
Gary 2022-01-09 20:45:25 +00:00
commit de11c5f3db
8 changed files with 110 additions and 0 deletions

1
.gitignore vendored 100644
View File

@ -0,0 +1 @@
*.retry

16
README.md 100644
View File

@ -0,0 +1,16 @@
# Raspberry Pi NOC Screen
This Ansible playbook will install the necessary software and configuration to point at a NOC Screen webpage
> __NOTE:__ This will not change the password, you will either need to change this before or after
> You can either change the password beforehand, alternatively install SSH Keys and remove passwords
To invoke the playbook make sure you have updated the `inv.yml` for your needs, then run as follows:
```bash
# Run against all hosts (-kK is to ask for the SSH/SUDO Password)
ansible-playbook -i inv.yml setup-screen.yml -kK
# Run against limited hosts
ansible-playbook -i inv.yml setup-screen.yml -kK -l *host*
```

View File

@ -0,0 +1,3 @@
[SeatDefaults]
autologin-user=screen-user
user-session=openbox

View File

@ -0,0 +1,7 @@
- hosts: all
gather_facts: False
become: yes
tasks:
- name: install python 2
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)

View File

@ -0,0 +1,7 @@
- hosts: all
gather_facts: False
become: yes
tasks:
- name: install python 3
raw: test -e /usr/bin/python || (apt -y update && apt install -y python3-minimal)

18
inv.yml 100644
View File

@ -0,0 +1,18 @@
all:
vars:
nocweburl: https://www.example.com/screen/
ansible_user: pi
children:
prod:
hosts:
screen1:
ansible_host: 203.0.113.47
screen2:
ansible_host: 203.0.113.49
screen3:
ansible_host: 203.0.113.49
dev:
hosts:
screen0:
ansible_host: 203.0.113.50
ansible_user: sysadmin

44
screen-setup.yml 100644
View File

@ -0,0 +1,44 @@
---
- hosts: all
become: yes
tasks:
- name: Apt Update Cache
apt:
update_cache: yes
cache_valid_time: 3600
- name: Install Needed Packages
apt: name={{item}} state=installed
with_items:
- vim
- sudo
- xorg
- chromium-browser
- openbox
- lightdm
- unclutter
- name: lightdm config
copy: src=files/lightdm.conf dest=/etc/lightdm/lightdm.conf
notify:
- restart host
- name: Add User
user: name=screen-user
- name: screen-user config directory
file: path=/home/screen-user/.config/openbox state=directory group=screen-user owner=screen-user recurse=yes
- name: screen-user openbox config
copy: src=template/openbox-autostart.j2 dest=/home/screen-user/.config/openbox/autostart
notify:
- restart host
handlers:
- name: restart host
command: systemd-run --on-active=1 systemctl reboot
async: 0
poll: 0

View File

@ -0,0 +1,14 @@
# Disable Screensaver
xset -dpms s off 2>&1 | tee /tmp/xset-log
# Launch Chrome
chromium-browser \
--no-first-run \
--disable \
--disable-translate \
--disable-infobars \
--disable-suggestions-service \
--disable-save-password-bubble \
--start-maximized \
--kiosk --app="{{ nocweburl }}?hostname=$(hostname -s)" &
# Unclutter
unclutter -idle 0 &