From 5b54e1e73e468de419283a815a5e67f49d231dd5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Filip=20Str=C3=B6mb=C3=A4ck?= <filip.stromback@liu.se>
Date: Wed, 30 Sep 2020 15:48:18 +0200
Subject: [PATCH] Using the new keep-repo-updated-script for the scripts dir in
 examadm.

---
 manifests/aes_sw.pp | 25 ++-----------------------
 1 file changed, 2 insertions(+), 23 deletions(-)

diff --git a/manifests/aes_sw.pp b/manifests/aes_sw.pp
index d7d3c25..0e873ee 100644
--- a/manifests/aes_sw.pp
+++ b/manifests/aes_sw.pp
@@ -84,36 +84,15 @@ class aes::aes_sw {
     ensure => "running",
   }
 
-  exec { 'script-repo-clone':
-    command => '/usr/bin/git clone --quiet --single-branch --branch master --depth 1 git@gitlab.liu.se:examadm/scripts.git',
+  exec { 'script-repo-updated':
+    command => "/opt/utils/update_repo.sh ${examadm_home}/scripts https://oauth2:iAyewr9Jq5E-tnsVrmbj@gitlab.liu.se/examadm/scripts.git master",
     cwd => "${examadm_home}",
-    creates => "${examadm_home}/scripts",
     user => "${examadm_user}",
     group => "${examadm_group}",
-    require => File["${examadm_home}/.ssh/known_hosts"],
   }
 
   schedule { 'everyday':
     period => daily,
     range => '01:00 - 04:00',
   }
-
-  exec { 'script-repo-pull':
-    command => '/usr/bin/git pull --depth 1',
-    cwd => "${examadm_home}/scripts",
-    onlyif => "/usr/bin/test -d ${examadm_home}/scripts/.git",
-    user => "${examadm_user}",
-    group => "${examadm_group}",
-#    schedule => 'everyday',
-  }
-
-  file { "${examadm_home}/.ssh/known_hosts":
-    ensure => present,
-    owner  => "${examadm_user}",
-    group  => "${examadm_group}",
-    mode => '0644',
-    content => @(KNOWNHOST)
-    gitlab.liu.se,2001:6b0:17:f003::44 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBF3yWjkuKo7f3OH4BhGwcd71lkWZqdyk7cxOCn5exPoqLldt2OfbhEA7lM+89Gr/AqRbHlbrS1M8An7j4Lj77hc=
-    | KNOWNHOST
-  }
 }
-- 
GitLab