From 61d0134704061321a8004b99416a1e2c3ae009e0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Filip=20Str=C3=B6mb=C3=A4ck?= <filip.stromback@liu.se>
Date: Tue, 29 Sep 2020 15:47:09 +0200
Subject: [PATCH] Started a module for the Broker. It currently only creates
 the user and not much more.

---
 manifests/aes_broker.pp | 37 ++++++++++++++++++++++++++++++++++---
 1 file changed, 34 insertions(+), 3 deletions(-)

diff --git a/manifests/aes_broker.pp b/manifests/aes_broker.pp
index b9a9e30..0c5ce64 100644
--- a/manifests/aes_broker.pp
+++ b/manifests/aes_broker.pp
@@ -1,12 +1,43 @@
 class aes::broker {
 
+  $broker_user = broker
+  $broker_group "${broker_user}"
+  $broker_home = "/srv/${broker_user}"
+  $broker_service = "${broker_user}"
+
+  # Sadly, it does not seem like we can only install asio, so we need
+  # to install the Boost as a whole.
+  # It is easiest to install just "boost", even if that is a bit older
+  # than what is available (others require modifying the include path).
+  # It is still enough for the broker.
   package {
     [
-	'devtoolset-7-gcc',
-	'devtoolset-7-gcc-c++',
-	'boost169',
+	'boost',
+	'boost-devel',
+	'krb5-libs',
+	'krb5-devel',
     ]:
       ensure => installed,
   }
 
+  user { "${broker_user}" :
+    ensure => present,
+    home => "${broker_user}",
+    comment => 'Message broker for AES',
+    managehome => false,
+    membership => inclusive,
+    system => true,
+    shell => '/sbin/nologin',
+  }
+
+  file { "${broker_home}" :
+    ensure => directory,
+    owner => "${broker_user}",
+    group => "${broker_group}",
+    mode => '0755',
+  }
+
+  # TODO: We still need to download the source from Git as needed and update the broker and auth service.
+  # To compile the broker, we need to do "source /opt/rh/devtoolset-7/enable" first. Otherwise, we will not get a good enough GCC.
+
 }
\ No newline at end of file
-- 
GitLab