Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
aes
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
liu-puppet-modules
aes
Commits
3aa9aa2f
You need to sign in or sign up before continuing.
Commit
3aa9aa2f
authored
1 year ago
by
Filip Strömbäck
Browse files
Options
Downloads
Patches
Plain Diff
Migrated OpenDSA to use vcsrepo.
parent
d98c7ae9
No related branches found
No related tags found
2 merge requests
!50
Fix: Puppet Defining "data_provider": "hiera" in metadata.json is deprecated....
,
!40
Merge from devel. Commits related to RHEL9 upgrade and pdk cleanup.
Pipeline
#101987
passed
1 year ago
Stage: puppet
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
files/opendsa/on_update.sh
+0
-11
0 additions, 11 deletions
files/opendsa/on_update.sh
manifests/latex.pp
+1
-1
1 addition, 1 deletion
manifests/latex.pp
manifests/opendsa.pp
+22
-10
22 additions, 10 deletions
manifests/opendsa.pp
with
23 additions
and
22 deletions
files/opendsa/on_update.sh
+
0
−
11
View file @
3aa9aa2f
...
...
@@ -3,9 +3,6 @@
# This file is called whenever the OpenDSA repo was updated. This means we should re-check
# the requirements.txt file and restart the service.
# Note: This file is executed as root, so we drop back to the opendsa user before starting pip.
update_pip_fn
=
$(
cat
<<
'
EOF
'
cd
python3
-m
pip
install
--user
-r
OpenDSA/server/requirements.txt
...
...
@@ -15,11 +12,3 @@ then
cd
OpenDSA/server/
./main.py init_db
fi
EOF
)
# Run PIP as OpenDSA.
sudo
--user
opendsa
--group
opendsa
--set-home
--
bash
-c
"
$update_pip_fn
"
# Then, we can restart the service.
systemctl service restart opendsa.service
This diff is collapsed.
Click to expand it.
manifests/latex.pp
+
1
−
1
View file @
3aa9aa2f
# @summary
#
Describe what this class do!
#
Install required LaTeX packages for PDF generation.
#
# Detailed summary info if suitable
#
...
...
This diff is collapsed.
Click to expand it.
manifests/opendsa.pp
+
22
−
10
View file @
3aa9aa2f
# @summary
#
Describe what this class do!
#
OpenDSA server for exams.
#
# Detailed summary info if suitable
#
...
...
@@ -30,9 +30,9 @@ class aes::opendsa {
# This file will be executed as root, which is why we don't let anyone but root examine it.
file
{
"
${opendsa_home}
/on_update.sh"
:
ensure
=>
file
,
owner
=>
root
,
group
=>
root
,
mode
=>
'07
00
'
,
owner
=>
$opendsa_user
,
group
=>
$opendsa_group
,
mode
=>
'07
55
'
,
source
=>
"puppet:///modules/
${module_name}
/opendsa/on_update.sh"
,
}
...
...
@@ -44,14 +44,26 @@ class aes::opendsa {
source
=>
"puppet:///modules/
${module_name}
/opendsa/opendsa.service"
,
}
exec
{
'update-repo'
:
command
=>
"/opt/utils/update_repo.sh
${opendsa_home}
/OpenDSA https://oauth2:taNPRZid9Hv6jJtdW_T8@gitlab.liu.se/opendsa/OpenDSA.git exam"
,
environment
=>
[
"REPO_USER=
${opendsa_user}
"
,
"REPO_GROUP=
${opendsa_group}
"
,
"REPO_ON_UPDATE=
${opendsa_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
{
"
${opendsa_home}
/src"
:
ensure
=>
latest
,
provider
=>
git
,
source
=>
'https://oauth2:taNPRZid9Hv6jJtdW_T8@gitlab.liu.se/opendsa/OpenDSA.git'
,
revision
=>
'exam'
,
owner
=>
$opendsa_user
,
group
=>
$opendsa_group
,
notify
=>
Exec
[
'update-opendsa-repo'
],
}
exec
{
'update-opendsa-repo'
:
user
=>
$opendsa_user
,
group
=>
$opendsa_group
,
cwd
=>
$opendsa_home
,
path
=>
'/bin:/usr/bin'
,
environment
=>
[
"HOME=
${opendsa_home}
"
],
command
=>
"
${opendsa_home}
/on_update.sh"
,
require
=>
File
[
"
${opendsa_home}
/on_update.sh"
],
notify
=>
Service
[
$opendsa_service
],
refreshonly
=>
true
}
file
{
"
${opendsa_home}
/manage.sh"
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment