# @summary # Command-line interface to TAL. # # Clones and compiles repo to provide TAL access. # # # @param credentials # Credentials for TAL access. # class aes::tal_cli ( Optional[String] $credentials = undef ) { file { '/home/examadm/tal-cli' : ensure => directory, owner => examadm, group => examadm, mode => '0700', } file { '/home/examadm/bin/tal-cli' : ensure => file, owner => examadm, group => examadm, mode => '0755', source => "puppet:///modules/${module_name}/tal/tal-cli", } file { '/home/examadm/bin/tal-export' : ensure => file, owner => examadm, group => examadm, mode => '0755', source => "puppet:///modules/${module_name}/tal/tal-export", } file { '/home/examadm/tal-cli/.tal' : ensure => file, owner => examadm, group => examadm, mode => '0600', content => $credentials, } file { '/home/examadm/tal-cli/on_update.sh' : ensure => file, owner => examadm, group => examadm, mode => '0700', source => "puppet:///modules/${module_name}/tal/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' : ensure => file, owner => 'root', group => 'root', mode => '0700', # lint:ignore:strict_indent heredoc failing... content => @(END), #!/bin/bash if [ "$(hostname)" = "aes-devel.edu.liu.se" ] then TO="klas.arvidsson@liu.se" else TO="inrapportering@ida.liu.se" fi if [ -e /home/examadm/ENABLE_TAL_REMINDERS ] then sudo -u examadm /home/examadm/tal-cli/source/scripts/tal-remind.py --to ${TO} --send sudo -u examadm /home/examadm/tal-cli/source/scripts/tal-remind.py --to ${TO} --computer-exam --send fi | END # lint:endignore:strict_indent } }