-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Johannes Fleischer <[email protected]>
- Loading branch information
1 parent
9c3bd1d
commit 6d66485
Showing
14 changed files
with
197 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
# Custom | ||
films/* | ||
poster/* | ||
mongo/db | ||
films/ | ||
poster/ | ||
mongo/db/ | ||
ansible/collections/ | ||
!.gitkeep | ||
|
||
# Logs | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[defaults] | ||
roles_path = ./roles | ||
inventory = ./inventory | ||
collections_paths = ./collections | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
- name: Install senior-movie-selector on a pie | ||
hosts: pi | ||
|
||
vars_files: | ||
- vars/vars.yml | ||
|
||
roles: | ||
- senior-movie-selector |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[pi] | ||
"{{ host_ip_address }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
collections: | ||
- name: community.docker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# General | ||
|
||
With this role you can install the [senior-movie-selector](https://github.com/JohannesFleischer/senior-movie-selector) project on a raspberry pi with the raspbian 64-bit OS | ||
|
||
Besides the installation there is also a autostart functionality added that automatically restarts the application on startup and starts chromium in fullscreen with the client opened. | ||
|
||
## Supported Platforms | ||
|
||
tested on and written for raspbian 64bit | ||
the installation probably works also on other Debian based operating systems but the autostart on boot wont work |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
|
||
senior_movie_selector_version: "{{ version }}" | ||
|
||
senior_movie_selector_films_path: "{{ films_media_path }}" | ||
|
||
senior_movie_selector_poster_path: "{{ poster_media_path }}" | ||
|
||
senior_movie_selector_project_dir: "{{ project_dir }}" | ||
|
||
senior_movie_selector_project_owner: "{{ host_username }}" | ||
|
||
senior_movie_selector_setup_autostart: "{{ setup_autostart }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
galaxy_info: | ||
author: Johannes Fleischer | ||
description: Sets up the Senior-Movie-selector project on raspbian (64bit). | ||
|
||
issue_tracker_url: https://github.com/JohannesFleischer/senior-movie-selector/issues | ||
|
||
license: All rights reserved. | ||
|
||
min_ansible_version: "2.1" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
--- | ||
- name: Make sure directories exists | ||
ansible.builtin.file: | ||
path: "{{ item }}" | ||
state: directory | ||
mode: "0700" | ||
loop: | ||
- "{{ senior_movie_selector_project_dir }}" | ||
- "{{ senior_movie_selector_project_dir }}/mongo/db" | ||
- "/home/{{ senior_movie_selector_project_owner }}/.config/autostart" | ||
|
||
# Create films directory or symlink: | ||
- name: Create 'films' directory if the path is empty | ||
ansible.builtin.file: | ||
path: "{{ senior_movie_selector_project_dir }}/films" | ||
state: directory | ||
mode: "0700" | ||
when: senior_movie_selector_films_path == "" | ||
|
||
- name: Make sure the 'films' link exists if the path is not empty | ||
ansible.builtin.file: | ||
src: "{{ senior_movie_selector_films_path }}" | ||
dest: "{{ senior_movie_selector_project_dir }}/films" | ||
state: link | ||
when: senior_movie_selector_films_path != "" | ||
|
||
# Create poster directory or symlink: | ||
- name: Make sure the 'poster' directory exists if the path is empty | ||
ansible.builtin.file: | ||
path: "{{ senior_movie_selector_project_dir }}/poster" | ||
state: directory | ||
mode: "0700" | ||
when: senior_movie_selector_poster_path == "" | ||
|
||
- name: Make sure the 'poster' link exists if the path is not empty | ||
ansible.builtin.file: | ||
src: "{{ senior_movie_selector_poster_path }}" | ||
dest: "{{ senior_movie_selector_project_dir }}/poster" | ||
state: link | ||
when: senior_movie_selector_poster_path != "" | ||
|
||
# Create necessary files | ||
- name: Download docker-compose.yml | ||
ansible.builtin.get_url: | ||
url: "https://raw.githubusercontent.com/JohannesFleischer/senior-movie-selector/{{ senior_movie_selector_version }}/docker-compose.yml" | ||
dest: "{{ senior_movie_selector_project_dir }}/docker-compose.yml" | ||
mode: "0700" | ||
|
||
- name: Create autostart files from template if selected | ||
ansible.builtin.template: | ||
src: "{{ item.src_file }}" | ||
dest: "{{ item.dest_file }}" | ||
mode: "0700" | ||
loop: | ||
- { | ||
src_file: "senior-movie-selector.desktop.j2", | ||
dest_file: "/home/{{ senior_movie_selector_project_owner }}/.config/autostart/senior-movie-selector.desktop" | ||
} | ||
- { | ||
src_file: "senior-movie-selector.sh.j2", | ||
dest_file: "/home/{{ senior_movie_selector_project_owner }}/Desktop/senior-movie-selector.sh" | ||
} | ||
when: senior_movie_selector_setup_autostart | ||
|
||
- name: Install pip | ||
ansible.builtin.apt: | ||
name: python3-pip | ||
|
||
- name: Install docker and docker-compose python package | ||
ansible.builtin.pip: | ||
name: | ||
- docker | ||
- docker-compose | ||
|
||
- name: Start senior-movie-selector | ||
community.docker.docker_compose: | ||
project_src: "{{ senior_movie_selector_project_dir }}" | ||
state: present |
8 changes: 8 additions & 0 deletions
8
ansible/roles/senior-movie-selector/templates/senior-movie-selector.desktop.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[Desktop Entry] | ||
Name=Senior Movie Selector | ||
Comment=Startet das senior-movie-selector Project | ||
Type=Application | ||
Hidden=false | ||
NoDisplay=false | ||
X-GNOME-Autostart-enabled=true | ||
Exec=lxterminal -e "/home/{{ senior_movie_selector_project_owner }}/Desktop/senior-movie-selector.sh" |
6 changes: 6 additions & 0 deletions
6
ansible/roles/senior-movie-selector/templates/senior-movie-selector.sh.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#! /bin/sh | ||
|
||
echo "starting senior-movie-selector" | ||
cd "{{ senior_movie_selector_project_dir }}" && sudo docker compose restart | ||
xhost + && chromium-browser --disable-gpu --start-fullscreen localhost | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
|
||
# The name of your pi user | ||
host_username: pi | ||
|
||
# The local ip of your pi. The default value is just an example | ||
host_ip_address: "192.168.178.63" | ||
|
||
# The release version of the senior-movie-selector project you want to install | ||
version: v1.0.1 | ||
|
||
# The directory you want the project to be stored in on your pi | ||
project_dir: "/home/{{ host_username }}/senior-movie-selector" | ||
|
||
# Path to the media folder with the films if you want to replace the default folders with links to the folder. Leave empty if thats not the case | ||
films_media_path: "" | ||
|
||
# Path to the media folder with the poster if you want to replace the default folders with links to the folder. Leave empty if thats not the case | ||
poster_media_path: "" | ||
|
||
# With this variable you can choose whether the autostart configuration should be applied. | ||
# When activated this role adds two files that try to pull and restart the project on startup and launch chromium in fullscreen with the Client opened | ||
# Options: true/false | ||
setup_autostart: true | ||
|