2019-05-01 12:23:11 +00:00
|
|
|
- name: Create Mosquitto Directories
|
|
|
|
file:
|
|
|
|
path: "{{ item }}"
|
|
|
|
state: directory
|
|
|
|
with_items:
|
|
|
|
- "{{ mosquitto_data_directory }}/config"
|
|
|
|
- "{{ mosquitto_data_directory }}/data"
|
|
|
|
- "{{ mosquitto_data_directory }}/log"
|
|
|
|
|
|
|
|
- name: Template mosquitto.conf
|
|
|
|
template:
|
|
|
|
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:
|
|
|
|
- "{{ mosquitto_data_directory }}:/config:rw"
|
|
|
|
- "{{ mosquitto_data_directory }}:/data:rw"
|
|
|
|
- "{{ mosquitto_data_directory }}:/log:rw"
|
|
|
|
env:
|
|
|
|
PUID: 1311
|
|
|
|
PGID: 1311
|
|
|
|
TZ: "{{ ansible_nas_timezone }}"
|
|
|
|
ports:
|
|
|
|
- "1883:1883"
|
|
|
|
- "9001:9001"
|
|
|
|
restart_policy: unless-stopped
|
|
|
|
memory: 1g
|