From c9cb91d05d52c8e1e07aab40e829f99d8031c87c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Str=C3=B6mb=C3=A4ck?= <filip.stromback@liu.se> Date: Mon, 21 Aug 2023 15:34:11 +0200 Subject: [PATCH] Updated tal-cli to use vcsrepo. --- manifests/tal_cli.pp | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/manifests/tal_cli.pp b/manifests/tal_cli.pp index 530af22..b581eb1 100644 --- a/manifests/tal_cli.pp +++ b/manifests/tal_cli.pp @@ -1,11 +1,11 @@ # @summary -# Describe what this class do! +# Command-line interface to TAL. # -# Detailed summary info if suitable +# Clones and compiles repo to provide TAL access. # # # @param credentials -# Describe credentials +# Credentials for TAL access. # class aes::tal_cli ( Optional[String] $credentials = undef @@ -49,12 +49,26 @@ class aes::tal_cli ( source => "puppet:///modules/${module_name}/tal/on_update.sh", } - 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'], + vcsrepo { '/home/examadm/tal-cli/source': + submodules => false, + ensure => latest, + provider => git, + source => 'https://oauth2:glpat-bfpVssm_zFmt1YRW7cLz@gitlab.liu.se/upp-aes/tal-cli.git', + revision => master, + owner => examadm, + group => examadm, + notify => Exec['compile-tal-repo'], + } + + exec { 'compile-tal-repo': user => examadm, group => examadm, cwd => '/home/examadm/tal-cli', + path => '/bin:/usr/bin', + environment => ['HOME=/home/examadm/tal-cli'], + creates => '/home/examadm/tal-cli/source/tal', + command => '/home/examadm/tal-cli/on_update.sh', + require => File['/home/examadm/tal-cli/on_update.sh'], } file { '/etc/cron.daily/tal-remind' : -- GitLab