Skip to content
Snippets Groups Projects
Commit 163f26c0 authored by Filip Strömbäck's avatar Filip Strömbäck
Browse files

Updated the broker to use vcsrepo as well.

parent ad96de01
No related branches found
No related tags found
2 merge requests!50Fix: Puppet Defining "data_provider": "hiera" in metadata.json is deprecated....,!40Merge from devel. Commits related to RHEL9 upgrade and pdk cleanup.
Pipeline #101955 passed
#!/bin/bash
run_as_broker=$(cat <<'EOF'
cd
# To make sure we have a decent GCC in our path.
source /opt/rh/devtoolset-7/enable
......@@ -17,12 +16,4 @@ cd
mkdir -p bin/
rm -f bin/broker
cp src/broker/broker bin/
EOF
)
# Compile as "broker".
sudo --user broker --group broker --set-home -- bash -c "$run_as_broker"
# Then, we can restart the services.
systemctl restart aes_broker.service
......@@ -138,13 +138,6 @@ class aes::aes_sw {
enable => true,
}
# 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,
# user => $examadm_user,
# group => $examadm_group,
# }
# Test to replace exec for repo update //thojo16
vcsrepo { "${examadm_home}/scripts":
ensure => latest,
......@@ -153,12 +146,6 @@ class aes::aes_sw {
revision => 'master',
owner => $examadm_user,
group => $examadm_group,
notify => Exec['TriggeredByUpdates'],
}
exec { 'TriggeredByUpdates':
path => '/bin/:/usr/bin/',
command => "touch ${examadm_home}/foo-vcsrepo",
refreshonly => true,
}
schedule { 'everyday':
......
......@@ -141,10 +141,10 @@ class aes::auth (
group => $auth_group,
cwd => $auth_home,
path => '/bin:/usr/bin',
command => "${auth_home}/on_update.sh",
environment => ["HOME=${auth_home}"],
refreshonly => true,
command => "${auth_home}/on_update.sh",
require => File["${auth_home}/on_update.sh"],
refreshonly => true,
notify => Service[$auth_service],
}
......
# @summary
# Describe what this class do!
# Message broker for the communication module.
#
# Detailed summary info if suitable
# Sets up the message broker for the communication module in the
# new exam system.
#
#
class aes::broker {
......@@ -93,14 +94,26 @@ class aes::broker {
source => "puppet:///modules/${module_name}/broker/cert/${server_type}_password",
}
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"],
# This command will need to run "on_update" as root in order to restart the service.
user => root,
group => root,
vcsrepo { "${broker_home}/src":
ensure => latest,
provider => git,
source => 'https://oauth2:F-agHaRXCdyFy38q4c-N@gitlab.liu.se/upp-aes/communication.git',
revision => $server_type,
owner => $broker_user,
group => $broker_group,
notify => 'compile-broker-repo',
}
exec { 'compile-broker-repo':
user => $broker_user,
group => $broker_group,
cwd => $broker_home,
require => File["${broker_home}/on_update.sh"],
path => '/bin:/usr/bin',
environment => ["HOME=${auth_home}"],
command => "${auth_home}/on_update.sh",
require => File["${auth_home}/on_update.sh"],
refreshonly => true,
notify => Service[$broker_service],
}
service { $broker_service :
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment