xoxys.mosquitto/tasks/install.yml

45 lines
1.0 KiB
YAML
Raw Normal View History

2017-12-16 20:33:26 +00:00
---
- name: Add yum repository
yum_repository:
name: mttq
file: mttq
description: MTTQ Broker
baseurl: http://download.opensuse.org/repositories/home:/oojah:/mqtt/CentOS_CentOS-7/
gpgkey: http://download.opensuse.org/repositories/home:/oojah:/mqtt/CentOS_CentOS-7/repodata/repomd.xml.key
- name: Install mttq packages
yum:
name: "{{ item }}"
state: installed
2017-12-16 20:39:50 +00:00
with_items:
2017-12-16 20:33:26 +00:00
- 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 }}'
state: present
- name: Create user '{{ mosquitto_user }}'
user:
name: '{{ mosquitto_user }}'
group: '{{ mosquitto_group }}'
system: yes
createhome: no
shell: /sbin/nologin
2017-12-16 21:14:07 +00:00
- name: Enable systemd service
systemd:
state: started
daemon_reload: yes
enabled: yes
name: mosquitto