40 lines
1.0 KiB
YAML
40 lines
1.0 KiB
YAML
---
|
|
- name: Add mttq repository
|
|
yum_repository:
|
|
name: mttq
|
|
file: mttq
|
|
description: MTTQ Broker
|
|
baseurl: "http://download.opensuse.org/repositories/home:/oojah:/mqtt/CentOS_CentOS-{{ ansible_distribution_major_version }}/"
|
|
gpgkey: "http://download.opensuse.org/repositories/home:/oojah:/mqtt/CentOS_CentOS-{{ ansible_distribution_major_version }}/repodata/repomd.xml.key"
|
|
|
|
- name: Install mttq packages
|
|
yum:
|
|
name: "{{ item }}"
|
|
state: installed
|
|
with_items:
|
|
- mosquitto
|
|
- mosquitto-clients
|
|
|
|
- name: Create group '{{ mosquitto_group }}'
|
|
group:
|
|
name: '{{ mosquitto_group }}'
|
|
state: present
|
|
|
|
- name: Create user '{{ mosquitto_user }}'
|
|
user:
|
|
name: '{{ mosquitto_user }}'
|
|
group: '{{ mosquitto_group }}'
|
|
system: yes
|
|
createhome: no
|
|
shell: /sbin/nologin
|
|
|
|
- name: Copy default configuration
|
|
template:
|
|
src: "etc/mosquitto/conf.d/default.conf.j2"
|
|
dest: "{{ mosquitto_config_dir }}/default.conf"
|
|
owner: root
|
|
group: root
|
|
mode: 0644
|
|
notify:
|
|
- mosquitto_restart
|