Add the photos role

This commit is contained in:
polyfloyd 2023-09-10 17:48:21 +02:00
parent 24c4d845ae
commit 786bb5cbdc
10 changed files with 169 additions and 0 deletions

View file

@ -0,0 +1,6 @@
---
- tags: photos_gallery
import_tasks: photo-gallery.yaml
- tags: photos_mqtt
import_tasks: photos2mqtt.yaml

View file

@ -0,0 +1,24 @@
---
- name: Clone source
git:
repo: https://github.com/bitlair/photo-gallery.git
version: master
dest: /opt/photo-gallery
accept_hostkey: yes
notify: restart photo-gallery
- name: Install photo-gallery service file
template:
src: photo-gallery.service
dest: /etc/systemd/system/photo-gallery.service
owner: root
group: root
mode: 0644
notify: restart photo-gallery
- name: Start photo-gallery
systemd:
name: photo-gallery
state: started
enabled: yes
daemon_reload: true

View file

@ -0,0 +1,34 @@
---
- name: Install dependencies
apt:
name:
- make
- liblinux-inotify2-perl
- name: Install mqtt-simple
command: cpan Net::MQTT::Simple
- name: Install photos2mqtt
template:
src: photos2mqtt.pl
dest: /opt/photos2mqtt.pl
owner: root
group: root
mode: 0755
notify: restart photos2mqtt
- name: Install photos2mqtt service file
template:
src: photos2mqtt.service
dest: /etc/systemd/system/photos2mqtt.service
owner: root
group: root
mode: 0644
notify: restart photos2mqtt
- name: Start photos2mqtt
systemd:
name: photos2mqtt
state: started
enabled: yes
daemon_reload: true