From 98299164314af25533921e5cea2014176fc9aa4e Mon Sep 17 00:00:00 2001
From: mikpe74 <mika.perala@liu.se>
Date: Wed, 8 Mar 2023 13:51:29 +0100
Subject: [PATCH] PDK errors corrected

---
 manifests/aes_sw.pp       | 17 ++++++++---------
 manifests/auth.pp         |  7 +++----
 manifests/auth_keydb.pp   |  7 +++----
 manifests/broker.pp       |  3 +--
 manifests/examfiles.pp    |  2 --
 manifests/init.pp         |  3 +--
 manifests/latex.pp        |  3 ---
 manifests/opendsa.pp      |  4 +---
 manifests/squid_filter.pp |  2 --
 manifests/tal_cli.pp      |  5 ++---
 10 files changed, 19 insertions(+), 34 deletions(-)

diff --git a/manifests/aes_sw.pp b/manifests/aes_sw.pp
index a042f00..a1f0c67 100644
--- a/manifests/aes_sw.pp
+++ b/manifests/aes_sw.pp
@@ -1,5 +1,4 @@
 class aes::aes_sw {
-
   $examadm_user = examadm
   $examadm_group = $examadm_user
   $examadm_home = "/home/${examadm_user}"
@@ -37,11 +36,11 @@ class aes::aes_sw {
 
   file { "${examadm_home}/.ssh/authorized_keys":
     ensure  => file,
-    mode   => '0600',
-    owner  => $examadm_user,
-    group  => $examadm_group,
+    mode    => '0600',
+    owner   => $examadm_user,
+    group   => $examadm_group,
     content => @(SSHPUBKEY),
-command="/home/examadm/tal-cli/source/scripts/tal-export.py --format ics --lookback 90 --lookahead 180",no-pty,no-user-rc,no-port-forwarding,no-agent-forwarding,no-X11-forwarding ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDJW4LP0av20r7lPXNgsftF9oaAXK41AvHyuHwybciZC/QBfTcmYif83563cTg0OzR/p+OSobiDM0odaaFYtP/8xbuVRz87X5bGYm2m8yHHqPxobHkT5g/faMkl9Fef+Al4EsT5tiaYMOhG2lj8XRYuwAb7qjoz3FFbs8TEPE7Sv+4BUCCH94taCuNYLXSxN1EXvw7VW6Ld5QXRFP53l2QUeTqE9oSii3BVrXlqqrLvNV/7nwdwyse4uhff4QrM9o4oc9FaQr8PLlPGxdlbSfIQJMVzHGpeDu0WLw+NqtLO1hsdlvQm7GrT/v8N7GJNKlsvhwnwUuMhTrB0yPMbbub1 klaar36@upp
+      command="/home/examadm/tal-cli/source/scripts/tal-export.py --format ics --lookback 90 --lookahead 180",no-pty,no-user-rc,no-port-forwarding,no-agent-forwarding,no-X11-forwarding ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDJW4LP0av20r7lPXNgsftF9oaAXK41AvHyuHwybciZC/QBfTcmYif83563cTg0OzR/p+OSobiDM0odaaFYtP/8xbuVRz87X5bGYm2m8yHHqPxobHkT5g/faMkl9Fef+Al4EsT5tiaYMOhG2lj8XRYuwAb7qjoz3FFbs8TEPE7Sv+4BUCCH94taCuNYLXSxN1EXvw7VW6Ld5QXRFP53l2QUeTqE9oSii3BVrXlqqrLvNV/7nwdwyse4uhff4QrM9o4oc9FaQr8PLlPGxdlbSfIQJMVzHGpeDu0WLw+NqtLO1hsdlvQm7GrT/v8N7GJNKlsvhwnwUuMhTrB0yPMbbub1 klaar36@upp
     | SSHPUBKEY
   }
 
@@ -51,7 +50,7 @@ command="/home/examadm/tal-cli/source/scripts/tal-export.py --format ics --lookb
     group   => root,
     mode    => '0644',
     content => @(LOGINSERVICE),
-    [Unit]
+          [Unit]
     Description=AES Login server
     After=network.target
 
@@ -78,7 +77,7 @@ command="/home/examadm/tal-cli/source/scripts/tal-export.py --format ics --lookb
     group   => root,
     mode    => '0644',
     content => @(MSSERVICE),
-    [Unit]
+          [Unit]
     Description=AES Exam server
     After=network.target
 
@@ -99,7 +98,7 @@ command="/home/examadm/tal-cli/source/scripts/tal-export.py --format ics --lookb
     group   => root,
     mode    => '0700',
     content => @(MSCRON),
-    #!/bin/sh
+          #!/bin/sh
     /usr/bin/systemctl restart aes_ms
     | MSCRON
   }
@@ -110,7 +109,7 @@ command="/home/examadm/tal-cli/source/scripts/tal-export.py --format ics --lookb
     group   => root,
     mode    => '0700',
     content => @(MSCRON),
-    #!/bin/sh
+          #!/bin/sh
     /usr/bin/systemctl restart aes_login
     | MSCRON
   }
diff --git a/manifests/auth.pp b/manifests/auth.pp
index 564425a..ae5ba62 100644
--- a/manifests/auth.pp
+++ b/manifests/auth.pp
@@ -1,8 +1,7 @@
-class aes::auth(
+class aes::auth (
   Optional[String] $keytab_production = undef,
   Optional[String] $keytab_devel = undef
 ) {
-
   $auth_user = auth
   $auth_group = $auth_user
   $auth_home = "/srv/${auth_user}"
@@ -47,7 +46,7 @@ class aes::auth(
     comment    => 'Authentication server for AES',
     managehome => false,
     membership => inclusive,
-    groups     => [ 'aes_local_auth' ],
+    groups     => ['aes_local_auth'],
     system     => true,
     shell      => '/sbin/nologin',
   }
@@ -110,7 +109,7 @@ class aes::auth(
 
   exec { 'update-auth-repo' :
     command     => "/opt/utils/update_repo.sh ${auth_home}/src https://oauth2:F-agHaRXCdyFy38q4c-N@gitlab.liu.se/upp-aes/communication.git ${server_type}",
-    environment => [ "REPO_USER=${auth_user}", "REPO_GROUP=${auth_group}", "REPO_ON_UPDATE=${auth_home}/on_update.sh" ],
+    environment => ["REPO_USER=${auth_user}", "REPO_GROUP=${auth_group}", "REPO_ON_UPDATE=${auth_home}/on_update.sh"],
     # This command will need to run "on_update" as root in order to restart the service.
     user        => root,
     group       => root,
diff --git a/manifests/auth_keydb.pp b/manifests/auth_keydb.pp
index fef8c92..f7a0c5a 100644
--- a/manifests/auth_keydb.pp
+++ b/manifests/auth_keydb.pp
@@ -1,5 +1,4 @@
 class aes::auth_keydb {
-
   $keydb_user = auth_keydb
   $keydb_group = $keydb_user
   $keydb_home = "/srv/${keydb_user}"
@@ -20,7 +19,7 @@ class aes::auth_keydb {
     comment    => 'Authentication server for AES',
     managehome => false,
     membership => inclusive,
-    groups     => [ 'aes_local_auth' ],
+    groups     => ['aes_local_auth'],
     system     => true,
     shell      => '/sbin/nologin',
   }
@@ -50,7 +49,7 @@ class aes::auth_keydb {
 
   exec { 'update-keydb-repo' :
     command     => "/opt/utils/update_repo.sh ${keydb_home}/src https://oauth2:F-agHaRXCdyFy38q4c-N@gitlab.liu.se/upp-aes/communication.git ${server_type}",
-    environment => [ "REPO_USER=${keydb_user}", "REPO_GROUP=${keydb_group}", "REPO_ON_UPDATE=${keydb_home}/on_update.sh" ],
+    environment => ["REPO_USER=${keydb_user}", "REPO_GROUP=${keydb_group}", "REPO_ON_UPDATE=${keydb_home}/on_update.sh"],
     # This command will need to run "on_update" as root in order to restart the service.
     user        => root,
     group       => root,
@@ -76,4 +75,4 @@ class aes::auth_keydb {
   service { 'aes_temp_userdb' :
     ensure => 'running',
   }
-}
\ No newline at end of file
+}
diff --git a/manifests/broker.pp b/manifests/broker.pp
index d01596f..3372440 100644
--- a/manifests/broker.pp
+++ b/manifests/broker.pp
@@ -1,5 +1,4 @@
 class aes::broker {
-
   $broker_user = broker
   $broker_group = $broker_user
   $broker_home = "/srv/${broker_user}"
@@ -90,7 +89,7 @@ class aes::broker {
 
   exec { 'update-broker-repo' :
     command     => "/opt/utils/update_repo.sh ${broker_home}/src https://oauth2:F-agHaRXCdyFy38q4c-N@gitlab.liu.se/upp-aes/communication.git ${server_type}",
-    environment => [ "REPO_USER=${broker_user}", "REPO_GROUP=${broker_group}", "REPO_ON_UPDATE=${broker_home}/on_update.sh" ],
+    environment => ["REPO_USER=${broker_user}", "REPO_GROUP=${broker_group}", "REPO_ON_UPDATE=${broker_home}/on_update.sh"],
     # This command will need to run "on_update" as root in order to restart the service.
     user        => root,
     group       => root,
diff --git a/manifests/examfiles.pp b/manifests/examfiles.pp
index 15eaf24..6571ba0 100644
--- a/manifests/examfiles.pp
+++ b/manifests/examfiles.pp
@@ -1,5 +1,4 @@
 class aes::examfiles {
-
   include users::micis03
   include users::jondy94
   include users::andma54
@@ -32,5 +31,4 @@ class aes::examfiles {
     owner  => root,
     group  => liuitdrs,
   }
-
 }
diff --git a/manifests/init.pp b/manifests/init.pp
index 4165103..1e59034 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -108,7 +108,7 @@ class aes {
 
   ::server_firewall::rules_file { '45-permit_squid.rules':
     content => @(EOF),
-    service squid is tcp/3128
+          service squid is tcp/3128
     service sclogin is tcp/23431
     service aesmsi is tcp/23816
     service aesmso is tcp/23817
@@ -123,5 +123,4 @@ class aes {
     end policy
     |-EOF
   }
-
 }
diff --git a/manifests/latex.pp b/manifests/latex.pp
index a607333..e2d1c8b 100644
--- a/manifests/latex.pp
+++ b/manifests/latex.pp
@@ -1,5 +1,4 @@
 class aes::latex {
-
   package {
     [
       'texlive',
@@ -15,6 +14,4 @@ class aes::latex {
     ]:
       ensure  => installed,
   }
-
-
 }
diff --git a/manifests/opendsa.pp b/manifests/opendsa.pp
index c54b242..c2e623d 100644
--- a/manifests/opendsa.pp
+++ b/manifests/opendsa.pp
@@ -1,5 +1,4 @@
 class aes::opendsa {
-
   $opendsa_user = opendsa
   $opendsa_group = $opendsa_user
   $opendsa_home = "/srv/${opendsa_user}"
@@ -41,7 +40,7 @@ class aes::opendsa {
 
   exec { 'update-repo':
     command     => "/opt/utils/update_repo.sh ${opendsa_home}/OpenDSA https://oauth2:taNPRZid9Hv6jJtdW_T8@gitlab.liu.se/opendsa/OpenDSA.git exam",
-    environment => [ "REPO_USER=${opendsa_user}", "REPO_GROUP=${opendsa_group}", "REPO_ON_UPDATE=${opendsa_home}/on_update.sh" ],
+    environment => ["REPO_USER=${opendsa_user}", "REPO_GROUP=${opendsa_group}", "REPO_ON_UPDATE=${opendsa_home}/on_update.sh"],
     # This command will need to run "on_update" as root in order to restart the service.
     user        => root,
     group       => root,
@@ -63,5 +62,4 @@ class aes::opendsa {
   }
 
   # Ändra TDDD86-raden i rules.d/opendsa till "TDDD86[AB]_191219"
-
 }
diff --git a/manifests/squid_filter.pp b/manifests/squid_filter.pp
index bb40123..3e64c0c 100644
--- a/manifests/squid_filter.pp
+++ b/manifests/squid_filter.pp
@@ -1,5 +1,4 @@
 class aes::squid_filter {
-
   package { 'squid' :
     ensure => 'present',
   }
@@ -65,5 +64,4 @@ class aes::squid_filter {
     ensure => 'running',
     enable => true,
   }
-
 }
diff --git a/manifests/tal_cli.pp b/manifests/tal_cli.pp
index dfc6b2c..d8bec90 100644
--- a/manifests/tal_cli.pp
+++ b/manifests/tal_cli.pp
@@ -1,7 +1,6 @@
-class aes::tal_cli(
+class aes::tal_cli (
   Optional[String] $credentials = undef
 ) {
-
   file { '/home/examadm/tal-cli' :
     ensure => directory,
     owner  => examadm,
@@ -43,7 +42,7 @@ class aes::tal_cli(
 
   exec { 'update-tal-repo' :
     command     => '/opt/utils/update_repo.sh /home/examadm/tal-cli/source https://oauth2:glpat-bfpVssm_zFmt1YRW7cLz@gitlab.liu.se/upp-aes/tal-cli.git master',
-    environment => [ 'REPO_ON_UPDATE=/home/examadm/tal-cli/on_update.sh' ],
+    environment => ['REPO_ON_UPDATE=/home/examadm/tal-cli/on_update.sh'],
     user        => examadm,
     group       => examadm,
     cwd         => '/home/examadm/tal-cli',
-- 
GitLab