forked from bitlair/ansible
photos: More Ansible config for the gallery service
This commit is contained in:
parent
d1f171abf0
commit
893c8133f5
7 changed files with 33 additions and 6 deletions
|
@ -1,8 +1,8 @@
|
||||||
---
|
---
|
||||||
- tags: photos_gallery
|
- tags: photos-gallery
|
||||||
import_tasks: photo-gallery.yaml
|
import_tasks: photo-gallery.yaml
|
||||||
|
|
||||||
- tags: photos_mqtt
|
- tags: photos-mqtt
|
||||||
import_tasks: photos2mqtt.yaml
|
import_tasks: photos2mqtt.yaml
|
||||||
|
|
||||||
- tags: bambulab-fetch
|
- tags: bambulab-fetch
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
---
|
---
|
||||||
|
- name: Install dependencies
|
||||||
|
apt:
|
||||||
|
name: [ nodejs, npm, imagemagick, graphicsmagick ]
|
||||||
|
|
||||||
- name: Clone source
|
- name: Clone source
|
||||||
git:
|
git:
|
||||||
repo: https://github.com/bitlair/photo-gallery.git
|
repo: https://github.com/bitlair/photo-gallery.git
|
||||||
|
@ -7,6 +11,15 @@
|
||||||
accept_hostkey: yes
|
accept_hostkey: yes
|
||||||
notify: restart photo-gallery
|
notify: restart photo-gallery
|
||||||
|
|
||||||
|
- name: Install photo-gallery config file
|
||||||
|
template:
|
||||||
|
src: photo-gallery-config.json
|
||||||
|
dest: /opt/photo-gallery/config.json
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: 0644
|
||||||
|
notify: restart photo-gallery
|
||||||
|
|
||||||
- name: Install photo-gallery service file
|
- name: Install photo-gallery service file
|
||||||
template:
|
template:
|
||||||
src: photo-gallery.service
|
src: photo-gallery.service
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# {{ ansible_managed }}
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Run every 15 minutes
|
Description=Run every 15 minutes
|
||||||
|
|
||||||
|
|
12
roles/photos/templates/photo-gallery-config.json
Normal file
12
roles/photos/templates/photo-gallery-config.json
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
"listen": {
|
||||||
|
"port": 4567
|
||||||
|
},
|
||||||
|
"pictureFolder": "{{ photos_path }}",
|
||||||
|
"thumbnails": {
|
||||||
|
"height": 300,
|
||||||
|
"quality": 60
|
||||||
|
},
|
||||||
|
"pathPrefix": "/fotos",
|
||||||
|
"paginationThreshold": 100
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
# Managed by Ansible
|
# {{ ansible_managed }}
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Gallery service
|
Description=Gallery service
|
||||||
|
@ -7,7 +7,7 @@ After=network.target
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=/usr/bin/node /opt/photo-gallery/server.js
|
ExecStart=/usr/bin/node /opt/photo-gallery/server.js
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=3
|
RestartSec=10
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/perl -w
|
#!/usr/bin/perl -w
|
||||||
|
|
||||||
# Managed by Ansible
|
# {{ ansible_managed }}
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use Net::MQTT::Simple;
|
use Net::MQTT::Simple;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Managed by Ansible
|
# {{ ansible_managed }}
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Photos to MQTT
|
Description=Photos to MQTT
|
||||||
|
|
Loading…
Add table
Reference in a new issue