Update frontend script.

Always restart reverse proxy
This commit is contained in:
2023-11-11 11:57:18 +00:00
parent d23badb2a2
commit 11f55cd96c
4 changed files with 66 additions and 61 deletions

3
README.md Normal file
View File

@@ -0,0 +1,3 @@
```bash
ansible-playbook -i inventory frontend.yaml
```

View File

@@ -37,12 +37,7 @@
become: true
tasks:
# - name: Install Docker
# ansible.builtin.include_tasks:
# file: tasks/install_docker.yaml
- name: Copy referse proxy configuration to host
- name: Copy reverse proxy configuration to host
become: true
ansible.builtin.copy:
src: apptabulous/reverseproxy
@@ -52,6 +47,7 @@
community.docker.docker_container:
name: reverse_proxy
image: nginx:mainline-alpine-slim
restart_policy: always
volumes:
- /etc/reverseproxy/conf.d:/etc/nginx/conf.d
- /etc/letsencrypt:/etc/letsencrypt
@@ -79,4 +75,3 @@
ports:
- "3000:3000"
state: started

View File

@@ -1,5 +1,5 @@
[kiosk]
kiosk@kiosk.localdomain
kiosk@kiosk.local
[frontend]
rpi4-2.local

View File

@@ -5,6 +5,16 @@
vars:
username: kiosk
docker_add_repo: true
docker_users:
- "{{ username }}"
roles:
- role: geerlingguy.docker
become: true
tasks:
# - name: Ensure raspi-config is up to date
# become: true
@@ -79,6 +89,12 @@
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/; s/"exit_type":"[^"]\+"/"exit_type":"Normal"/' ~/.config/chromium/Default/Preferences
chromium-browser --disable-infobars --kiosk ${WEBSITE:=https://bit.ly/shelford_kiosk}
- name: Configure openbox-session
ansible.builtin.blockinfile:
path: /home/{{ username }}/.xinitrc
create: true
line: "exec openbox-session"
- name: Start window manager
ansible.builtin.lineinfile:
path: /home/{{ username }}/.bash_profile
@@ -92,10 +108,6 @@
hour: "0,2,4,6,8,10,12,14,16,18,20,22"
job: "DISPLAY=:0.0 xdotool key ctrl+r"
- name: Install Docker
ansible.builtin.include_tasks:
file: tasks/install_docker.yaml
- name: Create kiosk config directory
ansible.builtin.file:
path: /home/{{ username }}/kiosk
@@ -130,19 +142,14 @@
done
# NOTE: This fails first time, but works after a manual pull from the target
# NOTE: get the error -> 'Connection aborted.', PermissionError(13, 'Permission denied')
- name: Install kiosk admin console
community.docker.docker_compose:
project_name: kiosk
pull: true
restarted: true
definition:
kiosk:
- name: Start admin console container
community.docker.docker_container:
name: website
image: hub.apptabulous.co.uk/apptabulous/kiosk:latest
restart: "always"
restart_policy: always
ports:
- "80:3000"
volumes:
- "/home/{{ username }}/kiosk:/app/kiosk"
- "/home/{{ username }}/commands:/app/commands"
state: started