summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Treinish <mtreinish@kortar.org>2016-07-25 16:20:50 -0400
committerMatthew Treinish <mtreinish@kortar.org>2016-07-25 16:22:36 -0400
commit5b97169e50514a100cc195807950e7b2c463d014 (patch)
treeb8898a506bf28260ce7fb041f57f8538b57816ca
parentc5f32fc7a483ba662c90d93e58d73c6aedbaf3ef (diff)
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.
-rw-r--r--manifests/server.pp17
-rw-r--r--templates/mosquitto.conf.erb13
2 files changed, 19 insertions, 11 deletions
diff --git a/manifests/server.pp b/manifests/server.pp
index 22afec5..ae719c8 100644
--- a/manifests/server.pp
+++ b/manifests/server.pp
@@ -15,12 +15,17 @@
15# == Class: mosquitto 15# == Class: mosquitto
16# 16#
17class mosquitto::server ( 17class mosquitto::server (
18 18 $pid_file = '/var/run/mosquitto.pid',
19 $log_file = '/var/log/mosquitto/mosquitto.log',
20 $persistence_location = '/var/lib/mosquitto/',
19) { 21) {
20 22
21file {'/etc/mosquitto/mosquitto.conf': 23 file {'/etc/mosquitto/mosquitto.conf':
22 ensure => present, 24 ensure => present,
23 content => template('mosquitto/mosquitto.conf.erb'), 25 owner => 'root',
24} 26 group => 'root',
25 27 mode => '0644',
28 content => template('mosquitto/mosquitto.conf.erb'),
29 require => Package['mosquitto'],
30 }
26} 31}
diff --git a/templates/mosquitto.conf.erb b/templates/mosquitto.conf.erb
index f0e1402..0112aff 100644
--- a/templates/mosquitto.conf.erb
+++ b/templates/mosquitto.conf.erb
@@ -32,7 +32,7 @@
32# This should be set to /var/run/mosquitto.pid if mosquitto is 32# This should be set to /var/run/mosquitto.pid if mosquitto is
33# being run automatically on boot with an init script and 33# being run automatically on boot with an init script and
34# start-stop-daemon or similar. 34# start-stop-daemon or similar.
35#pid_file 35pid_file <%= @pid_file %>
36 36
37# When run as root, drop privileges to this user and its primary 37# When run as root, drop privileges to this user and its primary
38# group. 38# group.
@@ -422,17 +422,18 @@
422# subscriptions, currently in-flight messages and retained 422# subscriptions, currently in-flight messages and retained
423# messages. 423# messages.
424# retained_persistence is a synonym for this option. 424# retained_persistence is a synonym for this option.
425#persistence false 425persistence true
426 426
427# The filename to use for the persistent database, not including 427# The filename to use for the persistent database, not including
428# the path. 428# the path.
429#persistence_file mosquitto.db 429#persistence_file
430 430
431# Location for persistent database. Must include trailing / 431# Location for persistent database. Must include trailing /
432# Default is an empty string (current directory). 432# Default is an empty string (current directory).
433# Set to e.g. /var/lib/mosquitto/ if running as a proper service on Linux or 433# Set to e.g. /var/lib/mosquitto/ if running as a proper service on Linux or
434# similar. 434# similar.
435#persistence_location 435persistence_location <%= @persistence_location %>
436
436 437
437# ================================================================= 438# =================================================================
438# Logging 439# Logging
@@ -463,6 +464,8 @@
463# Use "log_dest none" if you wish to disable logging. 464# Use "log_dest none" if you wish to disable logging.
464#log_dest stderr 465#log_dest stderr
465 466
467log_dest file <%= @log_file %>
468
466# If using syslog logging (not on Windows), messages will be logged to the 469# If using syslog logging (not on Windows), messages will be logged to the
467# "daemon" facility by default. Use the log_facility option to choose which of 470# "daemon" facility by default. Use the log_facility option to choose which of
468# local0 to local7 to log to instead. The option value should be an integer 471# local0 to local7 to log to instead. The option value should be an integer
@@ -809,7 +812,7 @@
809# in the main file. This option will only be processed from the main 812# in the main file. This option will only be processed from the main
810# configuration file. The directory specified must not contain the 813# configuration file. The directory specified must not contain the
811# main configuration file. 814# main configuration file.
812#include_dir 815include_dir /etc/mosquitto/conf.d
813 816
814# ================================================================= 817# =================================================================
815# rsmb options - unlikely to ever be supported 818# rsmb options - unlikely to ever be supported