mirror of
https://github.com/davestephens/ansible-nas
synced 2024-11-12 23:17:06 +00:00
Move Mosquitto to role
This commit is contained in:
parent
dc1c281c13
commit
40c3213915
6 changed files with 31 additions and 15 deletions
|
@ -1,4 +1,3 @@
|
|||
persistence true
|
||||
persistence_location /mosquitto/data/
|
||||
log_dest file /mosquitto/log/mosquitto.log
|
||||
|
||||
|
|
|
@ -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
|
||||
###
|
||||
|
|
9
nas.yml
9
nas.yml
|
@ -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
|
||||
|
|
16
roles/mosquitto/defaults/main.yml
Normal file
16
roles/mosquitto/defaults/main.yml
Normal 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
|
7
roles/mosquitto/files/mosquitto.conf
Normal file
7
roles/mosquitto/files/mosquitto.conf
Normal 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
|
||||
|
|
@ -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
|
Loading…
Reference in a new issue