diff options
author | Matthias Beyer <matthias.beyer@ifm.com> | 2022-01-15 20:16:31 +0100 |
---|---|---|
committer | Matthias Beyer <matthias.beyer@ifm.com> | 2022-02-14 16:04:54 +0100 |
commit | 7614962f733ca7c9ae05f68e04c1dff2088db97d (patch) | |
tree | deebeb7dfb22c61adba211855f9397a9a76186ee | |
parent | 73fda69ed77dff6e244d2d3c3962e097556d423b (diff) |
containers: Move mosquitto setup to mosquitto container setup
Signed-off-by: Matthias Beyer <matthias.beyer@ifm.com>
-rw-r--r-- | examples/containers.nix | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/examples/containers.nix b/examples/containers.nix index fb4259f6..cd62d23b 100644 --- a/examples/containers.nix +++ b/examples/containers.nix @@ -15,16 +15,10 @@ let useradd --system --no-create-home --shell /sbin/nologin -g tedge tedge install -g tedge -o tedge -m 755 -d /etc/tedge - install -g tedge -o tedge -m 755 -d /etc/tedge/mosquitto-conf - install -g mosquitto -o mosquitto -m 755 -d /etc/tedge/device-certs install -g tedge -o tedge -m 755 -d /etc/tedge/operations install -g tedge -o tedge -m 755 -d /etc/tedge/plugins install -g tedge -o tedge -m 755 -d /var/log/tedge - if ! ${pkgs.gnugrep}/bin/grep -q "/etc/tedge/mosquitto-conf" "/etc/mosquitto/mosquitto.conf"; then - echo "include_dir /etc/tedge/mosquitto-conf" >>/etc/mosquitto/mosquitto.conf - fi - echo "%tedge-users ALL = (ALL) /usr/bin/tedge" >/etc/sudoers.d/tedge-users if [ -f "/etc/sudoers.d/010_pi-nopasswd" ]; then @@ -57,6 +51,13 @@ in { groupadd mosquitto useradd --system --no-create-home --shell /sbin/nologin -g mosquitto mosquitto + + install -g mosquitto -o mosquitto -m 755 -d /etc/tedge/device-certs + install -g tedge -o tedge -m 755 -d /etc/tedge/mosquitto-conf + + if ! ${pkgs.gnugrep}/bin/grep -q "/etc/tedge/mosquitto-conf" "/etc/mosquitto/mosquitto.conf"; then + echo "include_dir /etc/tedge/mosquitto-conf" >>/etc/mosquitto/mosquitto.conf + fi ''; config = { |