IOT Playbook updated with docker networks and caddy.

This commit is contained in:
tanshu committed 2025-07-09 01:16:10 +00:00
1 parent 7c2a66540f
commit 3ff953acdb
13 files changed
+73 -62

No files matched your search

+8 -8
View File
@@ -35,10 +35,6 @@
owner: 1883 # "{{ mosquitto_user }}"
mode: 0646
# - name: Check if Mosquitto passwd file exists
# stat: path="{{ mosquitto_directory }}/config/passwd"
# register: status
- name: Ensure Mosquitto passwd file exists
template:
src: "files/passwd"
@@ -47,9 +43,6 @@
owner: 1883 # "{{ mosquitto_user }}"
mode: 0646
- name: Encrypt the docker file
command: docker exec -i mosquitto mosquitto_passwd -U /mosquitto/config/passwd
- name: Ensure Mosquitto Log Directory exists
file:
path: "{{ mosquitto_directory }}/log"
@@ -73,10 +66,17 @@
state: started
restart_policy: "unless-stopped"
# user: 0:0 # "{{ getent_passwd[mosquitto_user][1] }}:{{ getent_passwd[mosquitto_user][2] }}"
networks:
- name: "{{ docker_network }}"
aliases:
- mqtt
published_ports:
- 127.0.0.1:9001:9001
- 1883:1883
volumes:
- "{{ mosquitto_directory }}/config:/mosquitto/config"
- "{{ mosquitto_directory }}/data:/mosquitto/data"
- "{{ mosquitto_directory }}/log:/mosquitto/log"
- name: Encrypt the docker file
command: docker exec -i mosquitto mosquitto_passwd -U /mosquitto/config/passwd