first commit
This commit is contained in:
commit
9fa8f1ef9b
36 changed files with 686 additions and 0 deletions
53
README.md
Normal file
53
README.md
Normal file
|
@ -0,0 +1,53 @@
|
|||
# infoscreen-playbook
|
||||
## Voraussetzungen
|
||||
- RaspberryPi
|
||||
- SD-Karte mit frischem FullPageOS
|
||||
- ansible auf dem Rechner, an dem du gerade sitzt
|
||||
|
||||
## Nutzung:
|
||||
### FullPageOS auf SD-Karte installieren
|
||||
Anmerkung: wenn der konfigurierte User auf dem Raspi "pi" ist, ist die Version von FullpageOS egal. Wenn du aber einen eigenen Nutzernamen konfiguriert hast, dann musst du das Nightly-Build verwenden (das älteste davon reicht)
|
||||
|
||||
- RaspberryPi imager runterladen
|
||||
- Raspi-Modell wählen
|
||||
- OS wählen: "Other specific-purpose OS" --> "FullpageOS" --> "FullpageOS (Nightly)"
|
||||
- in den Einstellungen einen Nutzer und SSH-Key einfügen
|
||||
|
||||
Raspi booten (am Netz)
|
||||
Auf dem Rechner an dem du sitzt:
|
||||
|
||||
```
|
||||
git clone https://git.az-it.net/infoscreen
|
||||
cd infoscreen
|
||||
```
|
||||
dann in der infoscreen.yml Anpassungen vornehmen:
|
||||
- den User, den du beim Installieren im RaspberryPiImager gesetzt hast. (zwei mal!)
|
||||
- infoscreen_url: Hier kommt die URL rein, die angezeigt werden soll. (lässt sich später z.B. per MQTT auch steuern.)
|
||||
- Optional: Splash-Screen anpassen (siehe unten)
|
||||
- Optional: ssh-keys auf den Raspi-Schieben
|
||||
- Optional: Steuerung über MQTT aktivieren (siehe unten). Dazu benötigst du einen schon vorhandenen Broker. Das Display lässt sich dann per MQTT steuern.
|
||||
```
|
||||
ansible-playbook infoscreen.yml infoscreen-name-im-netzwerk,
|
||||
```
|
||||
** das Komma hinter dem infoscreen-namen ist wichtig! **
|
||||
|
||||
|
||||
|
||||
## optional: MQTT-Steuerung aktivieren
|
||||
- in infoscreen.yml die Variable auf true setzen
|
||||
- in roles/mqttDisplayClient/vars/main.yml die Konfiguration durchführen
|
||||
- mqtt-broker
|
||||
- port
|
||||
- username
|
||||
- password: kann im Klartext eingetragen werden (ist aber nicht empfohlen)
|
||||
mit ~# ansible-vault encrypt_string 'meinSicheresPasswort' --name 'password'
|
||||
kann man sich ein verschlüsseltes Kennwort anlegen, muss dabei ein vault-passwort vergeben
|
||||
- roles/mqttDisplayClient/templates/mqttDisplayClient.ini.j2 durchsehen und ggf topics anpassen oder HomeAssistant-Discovery abschalten
|
||||
|
||||
## optional: eigenen splash-screen einbauen
|
||||
- png-Datei mit 1920x1080 nach roles/lmnStuff/files/background.png kopieren
|
||||
|
||||
## optional: SSH-Keys hinzufügen
|
||||
Wenn du von verschiedenen Servern/Rechnern aus auf den infoscreen zugreifen möchtest, kannst du hier die Keys eintragen. Diese werden sowohl für den Nutzer als auch root auf dem Raspi gesetzt.
|
||||
- roles/sshKeys/vars/main.yml
|
||||
|
23
infoscreen.yml
Normal file
23
infoscreen.yml
Normal file
|
@ -0,0 +1,23 @@
|
|||
---
|
||||
- name: Konfiguration Infoscreen
|
||||
hosts: all
|
||||
gather_facts: yes
|
||||
become: yes
|
||||
become_user: root
|
||||
remote_user: morz # der existierende User auf dem Raspi
|
||||
vars:
|
||||
raspi_user: morz # leider nochmal definieren, für become_user in den Rollen.
|
||||
infoscreen_name: "{{ inventory_hostname }}"
|
||||
infoscreen_url: "https://info.morz.de/infoscreen/index.php"
|
||||
prepareHost: yes
|
||||
lmnStuff: yes
|
||||
enableMQTTFeature: no
|
||||
enableMQTTcronjob: no
|
||||
additionalSSHKeys: no
|
||||
|
||||
roles:
|
||||
- prepareHost
|
||||
- lmnStuff
|
||||
- sshKeys
|
||||
- mqttDisplayClient
|
||||
|
38
roles/lmnStuff/README.md
Normal file
38
roles/lmnStuff/README.md
Normal file
|
@ -0,0 +1,38 @@
|
|||
Role Name
|
||||
=========
|
||||
|
||||
A brief description of the role goes here.
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
||||
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
|
||||
|
||||
Role Variables
|
||||
--------------
|
||||
|
||||
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
|
||||
|
||||
Dependencies
|
||||
------------
|
||||
|
||||
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
|
||||
|
||||
Example Playbook
|
||||
----------------
|
||||
|
||||
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
|
||||
|
||||
- hosts: servers
|
||||
roles:
|
||||
- { role: username.rolename, x: 42 }
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
BSD
|
||||
|
||||
Author Information
|
||||
------------------
|
||||
|
||||
An optional section for the role authors to include contact information, or a website (HTML is not allowed).
|
3
roles/lmnStuff/defaults/main.yml
Normal file
3
roles/lmnStuff/defaults/main.yml
Normal file
|
@ -0,0 +1,3 @@
|
|||
#SPDX-License-Identifier: MIT-0
|
||||
---
|
||||
# defaults file for azitStuff
|
BIN
roles/lmnStuff/files/background.png
Normal file
BIN
roles/lmnStuff/files/background.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 301 KiB |
3
roles/lmnStuff/handlers/main.yml
Normal file
3
roles/lmnStuff/handlers/main.yml
Normal file
|
@ -0,0 +1,3 @@
|
|||
#SPDX-License-Identifier: MIT-0
|
||||
---
|
||||
# handlers file for azitStuff
|
35
roles/lmnStuff/meta/main.yml
Normal file
35
roles/lmnStuff/meta/main.yml
Normal file
|
@ -0,0 +1,35 @@
|
|||
#SPDX-License-Identifier: MIT-0
|
||||
galaxy_info:
|
||||
author: your name
|
||||
description: your role description
|
||||
company: your company (optional)
|
||||
|
||||
# If the issue tracker for your role is not on github, uncomment the
|
||||
# next line and provide a value
|
||||
# issue_tracker_url: http://example.com/issue/tracker
|
||||
|
||||
# Choose a valid license ID from https://spdx.org - some suggested licenses:
|
||||
# - BSD-3-Clause (default)
|
||||
# - MIT
|
||||
# - GPL-2.0-or-later
|
||||
# - GPL-3.0-only
|
||||
# - Apache-2.0
|
||||
# - CC-BY-4.0
|
||||
license: license (GPL-2.0-or-later, MIT, etc)
|
||||
|
||||
min_ansible_version: 2.1
|
||||
|
||||
# If this a Container Enabled role, provide the minimum Ansible Container version.
|
||||
# min_ansible_container_version:
|
||||
|
||||
galaxy_tags: []
|
||||
# List tags for your role here, one per line. A tag is a keyword that describes
|
||||
# and categorizes the role. Users find roles by searching for tags. Be sure to
|
||||
# remove the '[]' above, if you add tags to this list.
|
||||
#
|
||||
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
|
||||
# Maximum 20 tags per role.
|
||||
|
||||
dependencies: []
|
||||
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
|
||||
# if you add dependencies to this list.
|
19
roles/lmnStuff/tasks/main.yml
Normal file
19
roles/lmnStuff/tasks/main.yml
Normal file
|
@ -0,0 +1,19 @@
|
|||
---
|
||||
# tasks file for azitStuff
|
||||
# Hintergrundbild kopieren
|
||||
- name: Kopiere background.png nach splashscreen
|
||||
copy:
|
||||
src: files/background.png
|
||||
dest: /boot/firmware/splash.png
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
when: lmnStuff
|
||||
- name: Kopiere background.png nach /opt/custompios
|
||||
copy:
|
||||
src: files/background.png
|
||||
dest: /opt/custompios/background.png
|
||||
owner: "{{ raspi_user }}"
|
||||
group: "{{ raspi_user }}"
|
||||
mode: '0644'
|
||||
when: lmnStuff
|
3
roles/lmnStuff/tests/inventory
Normal file
3
roles/lmnStuff/tests/inventory
Normal file
|
@ -0,0 +1,3 @@
|
|||
#SPDX-License-Identifier: MIT-0
|
||||
localhost
|
||||
|
6
roles/lmnStuff/tests/test.yml
Normal file
6
roles/lmnStuff/tests/test.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
#SPDX-License-Identifier: MIT-0
|
||||
---
|
||||
- hosts: localhost
|
||||
remote_user: root
|
||||
roles:
|
||||
- azitStuff
|
3
roles/lmnStuff/vars/main.yml
Normal file
3
roles/lmnStuff/vars/main.yml
Normal file
|
@ -0,0 +1,3 @@
|
|||
#SPDX-License-Identifier: MIT-0
|
||||
---
|
||||
# vars file for azitStuff
|
38
roles/mqttDisplayClient/README.md
Normal file
38
roles/mqttDisplayClient/README.md
Normal file
|
@ -0,0 +1,38 @@
|
|||
Role Name
|
||||
=========
|
||||
|
||||
A brief description of the role goes here.
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
||||
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
|
||||
|
||||
Role Variables
|
||||
--------------
|
||||
|
||||
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
|
||||
|
||||
Dependencies
|
||||
------------
|
||||
|
||||
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
|
||||
|
||||
Example Playbook
|
||||
----------------
|
||||
|
||||
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
|
||||
|
||||
- hosts: servers
|
||||
roles:
|
||||
- { role: username.rolename, x: 42 }
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
BSD
|
||||
|
||||
Author Information
|
||||
------------------
|
||||
|
||||
An optional section for the role authors to include contact information, or a website (HTML is not allowed).
|
3
roles/mqttDisplayClient/defaults/main.yml
Normal file
3
roles/mqttDisplayClient/defaults/main.yml
Normal file
|
@ -0,0 +1,3 @@
|
|||
#SPDX-License-Identifier: MIT-0
|
||||
---
|
||||
# defaults file for mqttDisplayClient
|
6
roles/mqttDisplayClient/handlers/main.yml
Normal file
6
roles/mqttDisplayClient/handlers/main.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
# handlers file for mqttDisplayClient
|
||||
- name: Restart Service
|
||||
service:
|
||||
name: mqttDisplayClient
|
||||
state: restarted
|
35
roles/mqttDisplayClient/meta/main.yml
Normal file
35
roles/mqttDisplayClient/meta/main.yml
Normal file
|
@ -0,0 +1,35 @@
|
|||
#SPDX-License-Identifier: MIT-0
|
||||
galaxy_info:
|
||||
author: your name
|
||||
description: your role description
|
||||
company: your company (optional)
|
||||
|
||||
# If the issue tracker for your role is not on github, uncomment the
|
||||
# next line and provide a value
|
||||
# issue_tracker_url: http://example.com/issue/tracker
|
||||
|
||||
# Choose a valid license ID from https://spdx.org - some suggested licenses:
|
||||
# - BSD-3-Clause (default)
|
||||
# - MIT
|
||||
# - GPL-2.0-or-later
|
||||
# - GPL-3.0-only
|
||||
# - Apache-2.0
|
||||
# - CC-BY-4.0
|
||||
license: license (GPL-2.0-or-later, MIT, etc)
|
||||
|
||||
min_ansible_version: 2.1
|
||||
|
||||
# If this a Container Enabled role, provide the minimum Ansible Container version.
|
||||
# min_ansible_container_version:
|
||||
|
||||
galaxy_tags: []
|
||||
# List tags for your role here, one per line. A tag is a keyword that describes
|
||||
# and categorizes the role. Users find roles by searching for tags. Be sure to
|
||||
# remove the '[]' above, if you add tags to this list.
|
||||
#
|
||||
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
|
||||
# Maximum 20 tags per role.
|
||||
|
||||
dependencies: []
|
||||
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
|
||||
# if you add dependencies to this list.
|
48
roles/mqttDisplayClient/tasks/main.yml
Normal file
48
roles/mqttDisplayClient/tasks/main.yml
Normal file
|
@ -0,0 +1,48 @@
|
|||
---
|
||||
# tasks/main.yml
|
||||
- name: Überprüfen, ob die Installation schon durchgeführt wurde
|
||||
stat:
|
||||
path: "/home/{{ raspi_user }}/mqttDisplayClient/mqttDisplayClient.ini"
|
||||
register: setup_complete
|
||||
- name: Debug raspi_user vor dem Shell-Task
|
||||
debug:
|
||||
msg: "raspi_user: {{ raspi_user }}"
|
||||
|
||||
- name: Klone das mqttDisplayClient Git-Repository
|
||||
become: yes
|
||||
become_user: "{{ raspi_user }}"
|
||||
git:
|
||||
repo: "https://github.com/olialb/mqttDisplayClient"
|
||||
dest: "/home/{{ raspi_user }}/mqttDisplayClient"
|
||||
update: yes
|
||||
version: main # Stelle sicher, dass du den richtigen Branch verwendest (standardmäßig 'master')
|
||||
when: not setup_complete.stat.exists and enableMQTTFeature
|
||||
|
||||
- name: Installiere pyautogui und führe setup.sh aus
|
||||
become: yes
|
||||
become_user: "{{ raspi_user }}"
|
||||
shell: |
|
||||
cd "/home/{{ raspi_user }}/mqttDisplayClient"
|
||||
bash setup.sh -f pyautogui
|
||||
args:
|
||||
creates: "/home/{{ raspi_user }}/mqttDisplayClient/mqttDisplayClient.ini"
|
||||
when: enableMQTTFeature
|
||||
|
||||
- name: Template the config.ini file
|
||||
become: yes
|
||||
become_user: "{{ raspi_user }}"
|
||||
template:
|
||||
src: templates/mqttDisplayClient.ini.j2
|
||||
dest: "/home/{{ raspi_user }}/mqttDisplayClient/mqttDisplayClient.ini" # Der Pfad zur INI-Datei
|
||||
notify:
|
||||
- Restart Service
|
||||
when: enableMQTTFeature
|
||||
|
||||
- name: cron-Job für mqtt-befehl jede minute Mausklick und dann verstecken
|
||||
cron:
|
||||
name: "Autogui-Befehl ausführen"
|
||||
minute: "*"
|
||||
user: "{{ raspi_user }}"
|
||||
job: '/usr/bin/mosquitto_pub -h "{{ broker }}" -t "kiosk/01/{{ deviceName }}/autogui/set" -u "{{ username }}" -P "{{ password }}" -m "click(1895,52)"; sleep 1; /usr/bin/mosquitto_pub -h "{{ broker }}" -t "kiosk/01/{{ deviceName }}/autogui/set" -u "{{ username }}" -P "{{ password }}" -m "click(1920,1080)"'
|
||||
state: present
|
||||
when: enableMQTTFeature and enableMQTTcronjob
|
90
roles/mqttDisplayClient/templates/mqttDisplayClient.ini.j2
Normal file
90
roles/mqttDisplayClient/templates/mqttDisplayClient.ini.j2
Normal file
|
@ -0,0 +1,90 @@
|
|||
#
|
||||
# This file is part of the mqttDisplayClient distribution (https://github.com/olialb/mqttDisplayClient).
|
||||
# Copyright (c) 2025 Oliver Albold.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, version 3.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
[global]
|
||||
#set server ip adress and port
|
||||
broker={{ broker }}
|
||||
port={{ port }}
|
||||
#set username and password if needed:
|
||||
username={{ username }}
|
||||
password={{ password }}
|
||||
#change display ID 10-0045 to the value which you see in your system: ls /sys/class/backlight:
|
||||
displayID=10-0045
|
||||
#set root of topic path:
|
||||
topicRoot=kiosk/01
|
||||
#device name
|
||||
deviceName={{ deviceName }}
|
||||
#delay in seconds to try reconnect to server, if connection is lost:
|
||||
reconnectDelay=5
|
||||
#cycle time in seconds to publish changes in topics:
|
||||
publishDelay=3
|
||||
#Every publishcycle*fullPublishCycle will be all topics published even if no data changed:
|
||||
fullPublishCycle=20
|
||||
#location of the FullPageOS webpage config file
|
||||
defaultUrl=/boot/firmware/fullpageos.txt
|
||||
|
||||
[logging]
|
||||
#configure the log level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
|
||||
level={{ level }}
|
||||
|
||||
[feature]
|
||||
#enable display control with pyautogui. Allowed values (enabled/disabled)
|
||||
pyautogui=enabled
|
||||
#feature backlight alows you to control the brigtness off directly connected original raspberry pi displays like Touch Display 2
|
||||
#Disable this feature if you are not sure if your display support this feature! This avoids errors during startup.
|
||||
backlight=enabled
|
||||
#enable home assitant auto discovery
|
||||
haDiscover=
|
||||
|
||||
[brightness]
|
||||
min=0
|
||||
max=31
|
||||
#shell commands to set and get display brightness
|
||||
set=echo {value} | sudo tee /sys/class/backlight/{displayID}/brightness
|
||||
get=cat /sys/class/backlight/{displayID}/brightness
|
||||
|
||||
[backlight]
|
||||
ON=0
|
||||
OFF=1
|
||||
set=sudo echo {value} | sudo tee /sys/class/backlight/{displayID}/bl_power
|
||||
get=cat /sys/class/backlight/{displayID}/bl_power
|
||||
|
||||
[url]
|
||||
command=chromium --kiosk {url}
|
||||
|
||||
[panels]
|
||||
vplan=https://info.morz.de/infoscreen/index.php
|
||||
video=https://start.morz.de/infoscreenvideo.html
|
||||
clock=https://uhr.ptb.de|wait(1000);click(569,75)
|
||||
sommerferien=https://start.morz.de/sommerferien.html
|
||||
herbstferien=https://start.morz.de/herbstferien.html
|
||||
weihnachtsferien=https://start.morz.de/weihnachtsferien.html
|
||||
fastnachtsferien=https://start.morz.de/fastnachtsferien.html
|
||||
osterferien=https://start.morz.de/osterferien.html
|
||||
pfingstferien=https://start.morz.de/pfingstferien.html
|
||||
|
||||
[shellCommands]
|
||||
#you can define here commads and the MGTTMessage which can send to the system topic
|
||||
#Format: keyword=shell command
|
||||
shutdown=sudo shutdown now
|
||||
reboot=sudo reboot
|
||||
killall=sudo killall chromium
|
||||
|
||||
[haDiscover]
|
||||
#device name used in ha discover. You need to adapt it if you have more than one devives in your network
|
||||
deviceName={{ deviceName }}
|
||||
#standard base topic of home assitant discovers. Only need to be changed
|
||||
base=homeassistant
|
3
roles/mqttDisplayClient/tests/inventory
Normal file
3
roles/mqttDisplayClient/tests/inventory
Normal file
|
@ -0,0 +1,3 @@
|
|||
#SPDX-License-Identifier: MIT-0
|
||||
localhost
|
||||
|
6
roles/mqttDisplayClient/tests/test.yml
Normal file
6
roles/mqttDisplayClient/tests/test.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
#SPDX-License-Identifier: MIT-0
|
||||
---
|
||||
- hosts: localhost
|
||||
remote_user: root
|
||||
roles:
|
||||
- mqttDisplayClient
|
21
roles/mqttDisplayClient/vars/main.yml
Normal file
21
roles/mqttDisplayClient/vars/main.yml
Normal file
|
@ -0,0 +1,21 @@
|
|||
---
|
||||
# vars file for mqttDisplayClient
|
||||
#### Den Passwort-String erhält man mit
|
||||
####
|
||||
#### ~# ansible-vault encrypt_string 'meinSicheresPasswort' --name 'password'
|
||||
####
|
||||
raspinutzer: "{{ remote_user }}"
|
||||
broker: "dockerbox.morz.de"
|
||||
port: 1883
|
||||
username: "morz"
|
||||
password: !vault |
|
||||
$ANSIBLE_VAULT;1.1;AES256
|
||||
36626464646239306132346130646564373263356231303266326463353261666463356461336634
|
||||
6431303531343035663663623933343764353934626564370a613636653263326163333365373431
|
||||
36363531663736323439626434336461656530333863386664376133396330313261336361333433
|
||||
3965643439323038390a663664336638303963386431316338613030643362343737353831653166
|
||||
3232
|
||||
deviceName: "{{ ansible_hostname }}" # Der Hostname des Rechners wird automatisch eingefügt
|
||||
level: "CRITICAL"
|
||||
|
||||
|
38
roles/prepareHost/README.md
Normal file
38
roles/prepareHost/README.md
Normal file
|
@ -0,0 +1,38 @@
|
|||
Role Name
|
||||
=========
|
||||
|
||||
A brief description of the role goes here.
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
||||
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
|
||||
|
||||
Role Variables
|
||||
--------------
|
||||
|
||||
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
|
||||
|
||||
Dependencies
|
||||
------------
|
||||
|
||||
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
|
||||
|
||||
Example Playbook
|
||||
----------------
|
||||
|
||||
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
|
||||
|
||||
- hosts: servers
|
||||
roles:
|
||||
- { role: username.rolename, x: 42 }
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
BSD
|
||||
|
||||
Author Information
|
||||
------------------
|
||||
|
||||
An optional section for the role authors to include contact information, or a website (HTML is not allowed).
|
3
roles/prepareHost/defaults/main.yml
Normal file
3
roles/prepareHost/defaults/main.yml
Normal file
|
@ -0,0 +1,3 @@
|
|||
#SPDX-License-Identifier: MIT-0
|
||||
---
|
||||
# defaults file for prepareHost
|
3
roles/prepareHost/handlers/main.yml
Normal file
3
roles/prepareHost/handlers/main.yml
Normal file
|
@ -0,0 +1,3 @@
|
|||
#SPDX-License-Identifier: MIT-0
|
||||
---
|
||||
# handlers file for prepareHost
|
35
roles/prepareHost/meta/main.yml
Normal file
35
roles/prepareHost/meta/main.yml
Normal file
|
@ -0,0 +1,35 @@
|
|||
#SPDX-License-Identifier: MIT-0
|
||||
galaxy_info:
|
||||
author: your name
|
||||
description: your role description
|
||||
company: your company (optional)
|
||||
|
||||
# If the issue tracker for your role is not on github, uncomment the
|
||||
# next line and provide a value
|
||||
# issue_tracker_url: http://example.com/issue/tracker
|
||||
|
||||
# Choose a valid license ID from https://spdx.org - some suggested licenses:
|
||||
# - BSD-3-Clause (default)
|
||||
# - MIT
|
||||
# - GPL-2.0-or-later
|
||||
# - GPL-3.0-only
|
||||
# - Apache-2.0
|
||||
# - CC-BY-4.0
|
||||
license: license (GPL-2.0-or-later, MIT, etc)
|
||||
|
||||
min_ansible_version: 2.1
|
||||
|
||||
# If this a Container Enabled role, provide the minimum Ansible Container version.
|
||||
# min_ansible_container_version:
|
||||
|
||||
galaxy_tags: []
|
||||
# List tags for your role here, one per line. A tag is a keyword that describes
|
||||
# and categorizes the role. Users find roles by searching for tags. Be sure to
|
||||
# remove the '[]' above, if you add tags to this list.
|
||||
#
|
||||
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
|
||||
# Maximum 20 tags per role.
|
||||
|
||||
dependencies: []
|
||||
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
|
||||
# if you add dependencies to this list.
|
44
roles/prepareHost/tasks/main.yml
Normal file
44
roles/prepareHost/tasks/main.yml
Normal file
|
@ -0,0 +1,44 @@
|
|||
---
|
||||
# Setze den Hostnamen
|
||||
- name: Setze den Hostnamen
|
||||
hostname:
|
||||
name: "{{ infoscreen_name }}"
|
||||
when: prepareHost
|
||||
# Schreibe den Hostnamen in /etc/hostname
|
||||
- name: Schreibe den Hostnamen in /etc/hostname
|
||||
copy:
|
||||
content: "{{ infoscreen_name }}"
|
||||
dest: /etc/hostname
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
when: prepareHost
|
||||
|
||||
# Bearbeite /etc/hosts und stelle sicher, dass nur eine Zeile 127.0.1.1 existiert
|
||||
- name: Bearbeite /etc/hosts und setze die 127.0.1.1 Zeile
|
||||
lineinfile:
|
||||
path: /etc/hosts
|
||||
regexp: '^127\.0\.1\.1\s+.*'
|
||||
line: "127.0.1.1 {{ infoscreen_name }}"
|
||||
create: yes
|
||||
when: prepareHost
|
||||
|
||||
# Schreibe die URL in /boot/firmware/fullpageos.txt
|
||||
- name: Schreibe die URL in /boot/firmware/fullpageos.txt
|
||||
copy:
|
||||
content: "{{ infoscreen_url }}"
|
||||
dest: /boot/firmware/fullpageos.txt
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
when: prepareHost
|
||||
# Installiere den MQTT-Client zur Steuerung
|
||||
- name: Installiere mosquitto-clients und aktualisiere den APT-Cache nur bei Bedarf
|
||||
become: yes
|
||||
apt:
|
||||
name: mosquitto-clients
|
||||
state: present
|
||||
update_cache: yes
|
||||
cache_valid_time: 86400 # Gültigkeit des Cache 24 Stunden (86400 Sekunden)
|
||||
when: enableMQTTcronjob and prepareHost
|
||||
|
3
roles/prepareHost/tests/inventory
Normal file
3
roles/prepareHost/tests/inventory
Normal file
|
@ -0,0 +1,3 @@
|
|||
#SPDX-License-Identifier: MIT-0
|
||||
localhost
|
||||
|
6
roles/prepareHost/tests/test.yml
Normal file
6
roles/prepareHost/tests/test.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
#SPDX-License-Identifier: MIT-0
|
||||
---
|
||||
- hosts: localhost
|
||||
remote_user: root
|
||||
roles:
|
||||
- prepareHost
|
3
roles/prepareHost/vars/main.yml
Normal file
3
roles/prepareHost/vars/main.yml
Normal file
|
@ -0,0 +1,3 @@
|
|||
#SPDX-License-Identifier: MIT-0
|
||||
---
|
||||
# vars file for prepareHost
|
38
roles/sshKeys/README.md
Normal file
38
roles/sshKeys/README.md
Normal file
|
@ -0,0 +1,38 @@
|
|||
Role Name
|
||||
=========
|
||||
|
||||
A brief description of the role goes here.
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
||||
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
|
||||
|
||||
Role Variables
|
||||
--------------
|
||||
|
||||
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
|
||||
|
||||
Dependencies
|
||||
------------
|
||||
|
||||
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
|
||||
|
||||
Example Playbook
|
||||
----------------
|
||||
|
||||
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
|
||||
|
||||
- hosts: servers
|
||||
roles:
|
||||
- { role: username.rolename, x: 42 }
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
BSD
|
||||
|
||||
Author Information
|
||||
------------------
|
||||
|
||||
An optional section for the role authors to include contact information, or a website (HTML is not allowed).
|
3
roles/sshKeys/defaults/main.yml
Normal file
3
roles/sshKeys/defaults/main.yml
Normal file
|
@ -0,0 +1,3 @@
|
|||
#SPDX-License-Identifier: MIT-0
|
||||
---
|
||||
# defaults file for sshKeys
|
3
roles/sshKeys/handlers/main.yml
Normal file
3
roles/sshKeys/handlers/main.yml
Normal file
|
@ -0,0 +1,3 @@
|
|||
#SPDX-License-Identifier: MIT-0
|
||||
---
|
||||
# handlers file for sshKeys
|
35
roles/sshKeys/meta/main.yml
Normal file
35
roles/sshKeys/meta/main.yml
Normal file
|
@ -0,0 +1,35 @@
|
|||
#SPDX-License-Identifier: MIT-0
|
||||
galaxy_info:
|
||||
author: your name
|
||||
description: your role description
|
||||
company: your company (optional)
|
||||
|
||||
# If the issue tracker for your role is not on github, uncomment the
|
||||
# next line and provide a value
|
||||
# issue_tracker_url: http://example.com/issue/tracker
|
||||
|
||||
# Choose a valid license ID from https://spdx.org - some suggested licenses:
|
||||
# - BSD-3-Clause (default)
|
||||
# - MIT
|
||||
# - GPL-2.0-or-later
|
||||
# - GPL-3.0-only
|
||||
# - Apache-2.0
|
||||
# - CC-BY-4.0
|
||||
license: license (GPL-2.0-or-later, MIT, etc)
|
||||
|
||||
min_ansible_version: 2.1
|
||||
|
||||
# If this a Container Enabled role, provide the minimum Ansible Container version.
|
||||
# min_ansible_container_version:
|
||||
|
||||
galaxy_tags: []
|
||||
# List tags for your role here, one per line. A tag is a keyword that describes
|
||||
# and categorizes the role. Users find roles by searching for tags. Be sure to
|
||||
# remove the '[]' above, if you add tags to this list.
|
||||
#
|
||||
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
|
||||
# Maximum 20 tags per role.
|
||||
|
||||
dependencies: []
|
||||
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
|
||||
# if you add dependencies to this list.
|
18
roles/sshKeys/tasks/main.yml
Normal file
18
roles/sshKeys/tasks/main.yml
Normal file
|
@ -0,0 +1,18 @@
|
|||
---
|
||||
# Füge SSH-Schlüssel zu /root/.ssh/authorized_keys hinzu
|
||||
- name: Füge SSH-Schlüssel zu /root/.ssh/authorized_keys hinzu
|
||||
authorized_key:
|
||||
user: root
|
||||
state: present
|
||||
key: "{{ item }}"
|
||||
with_items: "{{ ssh_keys }}"
|
||||
when: additionalSSHKeys
|
||||
|
||||
# Füge SSH-Schlüssel zu /home/"{{ raspi_user }}"/.ssh/authorized_keys hinzu
|
||||
- name: Füge SSH-Schlüssel zu /home/morz/.ssh/authorized_keys hinzu
|
||||
authorized_key:
|
||||
user: "{{ raspi_user }}"
|
||||
state: present
|
||||
key: "{{ item }}"
|
||||
with_items: "{{ ssh_keys }}"
|
||||
when: additionalSSHKeys
|
3
roles/sshKeys/tests/inventory
Normal file
3
roles/sshKeys/tests/inventory
Normal file
|
@ -0,0 +1,3 @@
|
|||
#SPDX-License-Identifier: MIT-0
|
||||
localhost
|
||||
|
6
roles/sshKeys/tests/test.yml
Normal file
6
roles/sshKeys/tests/test.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
#SPDX-License-Identifier: MIT-0
|
||||
---
|
||||
- hosts: localhost
|
||||
remote_user: root
|
||||
roles:
|
||||
- sshKeys
|
9
roles/sshKeys/vars/main.yml
Normal file
9
roles/sshKeys/vars/main.yml
Normal file
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
# vars file for sshKeys
|
||||
ssh_keys:
|
||||
- "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICB+aRIazLzrmg7cHwXupbNbyNqOBGqVZPJlSQpUexyk jesko@BeispielKey-von-Jesko"
|
||||
- "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBOYEZrFjdcl42s6VEWggqU9gU2VycyQQ2cKZL2nCiTodhkyqGToBN9rMU82U61C7lDYGFDB8/2JwqDWGcFePSLc= root@beispiel.lmnserver.lan"
|
||||
- "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN0YkytmSbhRvVmhxDdPmMs6rlfvAel36rojS5vDzEPo root@beispiel2.lmndocker"
|
||||
- "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDC+E8jLTtHN24K35a1osMDK+f0e1pVE7Tnuw6Eb54QXJVvcuL0LZwE0ArubdxyKfeAHAs9xYyhl9mZ36tjZpRy4X0i/FTAQzHkCHMhTTKP+OfyUH4VKJtelkKspaxnMiQzwRNjHUVop1gT5MWJi0Or+dWdRDo5UJs2vSkXg9Ao0V7V4YT7Licz1aHx4nlH999j3vZuDkK9sG6TpmUX4yksVwz2kFFomXnRNWWp6wRPcrniGEXaWyFsV4FJwoUZwqSc5IvmeOo7LIr8Y3smTz0+wPfIq+qA7/PXlD7BckOnM+t4TcUj2bOyxuKrwM7pHkAOhlQCyGIkpyQMpnS+ct2t root@nocheinbeispielserver"
|
||||
|
||||
|
Loading…
Add table
Reference in a new issue