deploy mqtt config file

This commit is contained in:
Robert Kaussow 2017-12-16 22:49:18 +01:00
parent 80c01cf396
commit 565b470c82
2 changed files with 35 additions and 8 deletions

View File

@ -15,14 +15,6 @@
- mosquitto
- mosquitto-clients
- name: Copy systemd unit files
template:
src: "etc/systemd/system/mosquitto.service.j2"
dest: "/etc/systemd/system/mosquitto.service"
owner: root
group: root
mode: 0644
- name: Create group '{{ mosquitto_group }}'
group:
name: '{{ mosquitto_group }}'
@ -36,6 +28,22 @@
createhome: no
shell: /sbin/nologin
- name: Copy local configuration
template:
src: "etc/mosquitto/conf.d/local.conf.j2"
dest: "/etc/mosquitto/conf.d/local.conf"
owner: root
group: root
mode: 0644
- name: Copy systemd unit files
template:
src: "etc/systemd/system/mosquitto.service.j2"
dest: "/etc/systemd/system/mosquitto.service"
owner: root
group: root
mode: 0644
- name: Enable systemd service
systemd:
state: started

View File

@ -0,0 +1,19 @@
## {{ ansible_managed }}
port {{ mosquitto_port }}
user {{ mosquitto_user }}
persistence_file mosquitto.db
log_dest syslog
log_dest stdout
log_dest topic
log_type error
log_type warning
log_type notice
log_type information
log_timestamp true
connection_messages true
allow_anonymous false
password_file /etc/mosquitto/passwd