From eacfcfb454d1e5459a4042a2d08ce9c08abd612b Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Mon, 5 Nov 2018 00:19:24 +0100 Subject: [PATCH] fix become handling --- handlers/main.yml | 2 ++ .../etc/systemd/system/mosquitto.service.j2 | 19 ------------------- 2 files changed, 2 insertions(+), 19 deletions(-) delete mode 100644 templates/etc/systemd/system/mosquitto.service.j2 diff --git a/handlers/main.yml b/handlers/main.yml index 8667896..a57a674 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -6,3 +6,5 @@ name: mosquitto enabled: yes listen: __mosquitto_restart + become: True + become_user: root diff --git a/templates/etc/systemd/system/mosquitto.service.j2 b/templates/etc/systemd/system/mosquitto.service.j2 deleted file mode 100644 index 7c598a1..0000000 --- a/templates/etc/systemd/system/mosquitto.service.j2 +++ /dev/null @@ -1,19 +0,0 @@ -## {{ ansible_managed }} -[Unit] -Description=Mosquitto MQTT Broker daemon -ConditionPathExists=/etc/mosquitto/mosquitto.conf -After=network.target -Requires=network.target - -[Service] -Type=forking -RemainAfterExit=no -StartLimitInterval=0 -PIDFile={{ mosquitto_pid_file }} -ExecStart=/bin/sh -c "/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf -d" -ExecReload=/bin/kill -HUP $MAINPID -Restart=on-failure -RestartSec=2 - -[Install] -WantedBy=multi-user.target