Move Mosquitto to role

This commit is contained in:
David Stephens 2022-06-12 23:24:47 +01:00
parent dc1c281c13
commit 40c3213915
6 changed files with 31 additions and 15 deletions

View file

@ -1,4 +1,3 @@
persistence true
persistence_location /mosquitto/data/
log_dest file /mosquitto/log/mosquitto.log

View file

@ -290,14 +290,6 @@ wallabag_available_externally: "false"
wallabag_data_directory: "{{ docker_home }}/wallabag"
wallabag_port: "7780"
###
### Mosquitto
###
mosquitto_available_externally: "false"
mosquitto_data_directory: "{{ docker_home }}/mosquitto"
mosquitto_port_a: "1883"
mosquitto_port_b: "9001"
###
### Calibre-web
###

View file

@ -178,6 +178,11 @@
- miniflux
when: (miniflux_enabled | default(False))
- role: mosquitto
tags:
- mosquitto
when: (mosquitto_enabled | default(False))
- role: mylar
tags:
- mylar
@ -359,10 +364,6 @@
when: (wallabag_enabled | default(False))
tags: wallabag
- import_tasks: tasks/mosquitto.yml
when: (mosquitto_enabled | default(False))
tags: mosquitto
- import_tasks: tasks/calibre.yml
when: (calibre_enabled | default(False))
tags: calibre

View file

@ -0,0 +1,16 @@
---
mosquitto_enabled: false
# directories
mosquitto_data_directory: "{{ docker_home }}/mosquitto"
# uid / gid
mosquitto_user_id: "0"
mosquitto_group_id: "0"
# network
mosquitto_port_a: "1883"
mosquitto_port_b: "9001"
# specs
mosquitto_memory: 1g

View file

@ -0,0 +1,7 @@
persistence true
persistence_location /mosquitto/data/
log_dest file /mosquitto/log/mosquitto.log
log_dest stdout
listener 1883 0.0.0.0
allow_anonymous true

View file

@ -3,7 +3,6 @@
file:
path: "{{ item }}"
state: directory
mode: 0777
with_items:
- "{{ mosquitto_data_directory }}/config"
- "{{ mosquitto_data_directory }}/data"
@ -11,8 +10,9 @@
- name: Template mosquitto.conf
copy:
src: mosquitto/mosquitto.conf
src: mosquitto.conf
dest: "{{ mosquitto_data_directory }}/config/mosquitto.conf"
register: mosquitto_conf
- name: Create Mosquitto container
docker_container:
@ -27,4 +27,5 @@
- "{{ mosquitto_port_a }}:1883"
- "{{ mosquitto_port_b }}:9001"
restart_policy: unless-stopped
restart: "{{ mosquitto_conf is changed }}"
memory: 1g