2021-02-21 19:50:07 +00:00
|
|
|
---
|
2019-05-01 12:23:11 +00:00
|
|
|
- name: Create Mosquitto Directories
|
|
|
|
file:
|
|
|
|
path: "{{ item }}"
|
|
|
|
state: directory
|
2019-06-26 22:19:51 +00:00
|
|
|
mode: 0777
|
2019-05-01 12:23:11 +00:00
|
|
|
with_items:
|
|
|
|
- "{{ mosquitto_data_directory }}/config"
|
|
|
|
- "{{ mosquitto_data_directory }}/data"
|
|
|
|
- "{{ mosquitto_data_directory }}/log"
|
|
|
|
|
|
|
|
- name: Template mosquitto.conf
|
2019-06-26 22:19:51 +00:00
|
|
|
copy:
|
2019-05-01 12:23:11 +00:00
|
|
|
src: mosquitto/mosquitto.conf
|
|
|
|
dest: "{{ mosquitto_data_directory }}/config/mosquitto.conf"
|
|
|
|
|
|
|
|
- name: Create Mosquitto container
|
|
|
|
docker_container:
|
|
|
|
name: mosquitto
|
2019-06-25 17:26:16 +00:00
|
|
|
image: eclipse-mosquitto:latest
|
2019-05-01 12:23:11 +00:00
|
|
|
pull: true
|
|
|
|
volumes:
|
2019-06-26 22:19:51 +00:00
|
|
|
- "{{ mosquitto_data_directory }}/config/mosquitto.conf:/mosquitto/config/mosquitto.conf:rw"
|
|
|
|
- "{{ mosquitto_data_directory }}/data:/mosquitto/data:rw"
|
|
|
|
- "{{ mosquitto_data_directory }}/log:/mosquitto/log:rw"
|
2019-05-01 12:23:11 +00:00
|
|
|
ports:
|
2020-01-05 21:47:40 +00:00
|
|
|
- "{{ mosquitto_port_a }}:1883"
|
|
|
|
- "{{ mosquitto_port_b }}:9001"
|
2019-05-01 12:23:11 +00:00
|
|
|
restart_policy: unless-stopped
|
|
|
|
memory: 1g
|