From e61a6cf24693117c5126ddd9d67ceb0c829a63b0 Mon Sep 17 00:00:00 2001
From: Klas Arvidsson <klas.arvidsson@liu.se>
Date: Wed, 18 Dec 2019 11:39:26 +0100
Subject: [PATCH] puppet opendsa corrections after discussion with Filip

---
 files/squid/helpers/rules.d/opendsa.rules |  2 +-
 manifests/opendsa.pp                      | 25 ++++++++++++-----------
 2 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/files/squid/helpers/rules.d/opendsa.rules b/files/squid/helpers/rules.d/opendsa.rules
index 220b9b9..902b587 100644
--- a/files/squid/helpers/rules.d/opendsa.rules
+++ b/files/squid/helpers/rules.d/opendsa.rules
@@ -4,7 +4,7 @@
 
 ^https?://www\.ida\.liu\.se/edu/ugrad/datortenta/OpenDSA/Books/TDDI16_190827/.*  true
 ^https?://www\.ida\.liu\.se/edu/ugrad/datortenta/OpenDSA/Books/TDDE22_190827/.*  true
-^https?://www\.ida\.liu\.se/edu/ugrad/datortenta/OpenDSA/Books/TDDD86_190827/.*  true
+^https?://www\.ida\.liu\.se/edu/ugrad/datortenta/OpenDSA/Books/TDDD86[AB]_191219/.*  true
 ^https?://www\.ida\.liu\.se/edu/ugrad/datortenta/OpenDSA/lib/.*                  true
 ^https?://www\.ida\.liu\.se/edu/ugrad/datortenta/OpenDSA/JSAV/.*                 true
 ^https?://www\.ida\.liu\.se/edu/ugrad/datortenta/OpenDSA/AV/.*                   true
diff --git a/manifests/opendsa.pp b/manifests/opendsa.pp
index e7a8098..9d74970 100644
--- a/manifests/opendsa.pp
+++ b/manifests/opendsa.pp
@@ -12,8 +12,8 @@ class aes::opendsa {
     managehome => false,
     membership => inclusive,
     system => true,
-  # Do we need login shell
-    shell => '/sbin/nologin',
+  # Do we need login shell. YES
+    shell => '/bin/bash',
   }
 
   file { "${opendsa_home}":
@@ -26,7 +26,7 @@ class aes::opendsa {
   file { "${opendsa_home}/.ssh":
     ensure => directory,
     recurse => true,
-  # Is modes copied correctly by "recurse" option above? NO
+  # Is modes copied correctly by "recurse" option above? NO, but works
   # chmod 0700 .ssh/id_rsa
   # chmod 0744 .ssh/id_rsa.pub .ssh/known_hosts
     purge => true,
@@ -44,14 +44,15 @@ class aes::opendsa {
     group => "${opendsa_group}",
   }
 
-  exec { '/usr/bin/git pull' : 
-    cwd => "${opendsa_home}/OpenDSA",
-    onlyif => "/bin/test -d ${opendsa_home}/OpenDSA/.git",
-    user => "${opendsa_user}",
-    group => "${opendsa_group}",
-  }
+ # Will this work? DANGEROUS, need service restart! Not needed.
+  # exec { '/usr/bin/git pull' : 
+  #   cwd => "${opendsa_home}/OpenDSA",
+  #   onlyif => "/bin/test -d ${opendsa_home}/OpenDSA/.git",
+  #   user => "${opendsa_user}",
+  #   group => "${opendsa_group}",
+  # }
 
- # Install python packets. Can this be run several times safely? (Idempotent?)
+ # Install python packets. Can this be run several times safely? (Idempotent?) YES
   exec { '/usr/bin/python3 -m pip install --user -r OpenDSA/server/requirements.txt' : 
     cwd => "${opendsa_home}",
     user => "${opendsa_user}",
@@ -81,11 +82,11 @@ class aes::opendsa {
     source => "puppet:///modules/${module_name}/opendsa/opendsa.service",
   }
 
- # Do we need port 12000 open?
+ # Do we need port 12000 open? NO
   service { "${opendsa_service}" : 
     ensure => "running",
   }
 
-  # Ändra TDDD86-raden i config/opendsa till "TDDD86[AB]_191219" ???
+  # Ändra TDDD86-raden i rules.d/opendsa till "TDDD86[AB]_191219"
 
 }
-- 
GitLab