Make things work

This patch gets to a point where mosquitto is installed and configured
with sane defaults. The next step is to add configurability to the
point necessary for the infra use case.
This commit is contained in:
Matthew Treinish 2016-07-25 16:20:50 -04:00
parent c5f32fc7a4
commit 5b97169e50
No known key found for this signature in database
GPG Key ID: FD12A0F214C9E177
2 changed files with 19 additions and 11 deletions

View File

@ -15,12 +15,17 @@
# == Class: mosquitto
#
class mosquitto::server (
$pid_file = '/var/run/mosquitto.pid',
$log_file = '/var/log/mosquitto/mosquitto.log',
$persistence_location = '/var/lib/mosquitto/',
) {
file {'/etc/mosquitto/mosquitto.conf':
ensure => present,
content => template('mosquitto/mosquitto.conf.erb'),
}
file {'/etc/mosquitto/mosquitto.conf':
ensure => present,
owner => 'root',
group => 'root',
mode => '0644',
content => template('mosquitto/mosquitto.conf.erb'),
require => Package['mosquitto'],
}
}

View File

@ -32,7 +32,7 @@
# This should be set to /var/run/mosquitto.pid if mosquitto is
# being run automatically on boot with an init script and
# start-stop-daemon or similar.
#pid_file
pid_file <%= @pid_file %>
# When run as root, drop privileges to this user and its primary
# group.
@ -422,17 +422,18 @@
# subscriptions, currently in-flight messages and retained
# messages.
# retained_persistence is a synonym for this option.
#persistence false
persistence true
# The filename to use for the persistent database, not including
# the path.
#persistence_file mosquitto.db
#persistence_file
# Location for persistent database. Must include trailing /
# Default is an empty string (current directory).
# Set to e.g. /var/lib/mosquitto/ if running as a proper service on Linux or
# similar.
#persistence_location
persistence_location <%= @persistence_location %>
# =================================================================
# Logging
@ -463,6 +464,8 @@
# Use "log_dest none" if you wish to disable logging.
#log_dest stderr
log_dest file <%= @log_file %>
# If using syslog logging (not on Windows), messages will be logged to the
# "daemon" facility by default. Use the log_facility option to choose which of
# local0 to local7 to log to instead. The option value should be an integer
@ -809,7 +812,7 @@
# in the main file. This option will only be processed from the main
# configuration file. The directory specified must not contain the
# main configuration file.
#include_dir
include_dir /etc/mosquitto/conf.d
# =================================================================
# rsmb options - unlikely to ever be supported