31 lines
746 B
YAML
31 lines
746 B
YAML
---
|
|
- block:
|
|
- name: Install mqtt packages
|
|
package:
|
|
name: mosquitto
|
|
state: present
|
|
|
|
- name: Create group '{{ mosquitto_group }}'
|
|
group:
|
|
name: '{{ mosquitto_group }}'
|
|
state: present
|
|
|
|
- name: Create user '{{ mosquitto_user }}'
|
|
user:
|
|
name: '{{ mosquitto_user }}'
|
|
group: '{{ mosquitto_group }}'
|
|
home: "{{ mosquitto_base_dir }}"
|
|
system: yes
|
|
shell: /sbin/nologin
|
|
|
|
- name: Deploy default configuration
|
|
template:
|
|
src: "etc/mosquitto/mosquitto.conf.j2"
|
|
dest: "{{ mosquitto_base_dir }}/default.conf"
|
|
owner: root
|
|
group: root
|
|
mode: 0644
|
|
notify: __mosquitto_restart
|
|
become: True
|
|
become_user: root
|