Initial Commit
commit
de11c5f3db
|
|
@ -0,0 +1 @@
|
|||
*.retry
|
||||
|
|
@ -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*
|
||||
|
||||
```
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
[SeatDefaults]
|
||||
autologin-user=screen-user
|
||||
user-session=openbox
|
||||
|
|
@ -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)
|
||||
|
|
@ -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)
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
||||
|
|
@ -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 &
|
||||
Loading…
Reference in New Issue