deploy mqtt config file
This commit is contained in:
parent
80c01cf396
commit
565b470c82
@ -15,14 +15,6 @@
|
|||||||
- mosquitto
|
- mosquitto
|
||||||
- mosquitto-clients
|
- 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 }}'
|
- name: Create group '{{ mosquitto_group }}'
|
||||||
group:
|
group:
|
||||||
name: '{{ mosquitto_group }}'
|
name: '{{ mosquitto_group }}'
|
||||||
@ -36,6 +28,22 @@
|
|||||||
createhome: no
|
createhome: no
|
||||||
shell: /sbin/nologin
|
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
|
- name: Enable systemd service
|
||||||
systemd:
|
systemd:
|
||||||
state: started
|
state: started
|
||||||
|
19
templates/etc/mosquitto/conf.d/local.conf.j2
Normal file
19
templates/etc/mosquitto/conf.d/local.conf.j2
Normal 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
|
Loading…
Reference in New Issue
Block a user