Skip to content

Commit

Permalink
Merge branch 'conceptsandtraining:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Laura committed May 10, 2021
2 parents 0f6bff6 + 9b63544 commit d8caba6
Show file tree
Hide file tree
Showing 7 changed files with 121 additions and 78 deletions.
10 changes: 10 additions & 0 deletions src/lib/instances/create/create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,16 @@ then
docker exec -t -i ${DCMAINHASH} /bin/bash -c "salt '${NAME}.local' state.highstate saltenv=composer54 --state-output=terse"
fi

###################
# try autoinstaller
if (( ${ILIAS_VERSION} > 6 ))
then
NOW=$(date +'%d.%m.%Y %I:%M:%S')
echo "[${NOW}] Trying autoinstaller"

docker exec -t -i ${DCMAINHASH} /bin/bash -c "salt '${NAME}.local' state.highstate saltenv=autoinstall --state-output=terse"
fi

#########################
# finalizing docker image
NOW=$(date +'%d.%m.%Y %I:%M:%S')
Expand Down
3 changes: 3 additions & 0 deletions src/tpl/stack/config/master.cnf
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,9 @@ file_roots:
- /srv/salt/states/composer2
composer54:
- /srv/salt/states/composer54
autoinstall:
- /srv/salt/states/autoinstall


# The master_roots setting configures a master-only copy of the file_roots dictionary,
# used by the state compiler.
Expand Down
48 changes: 48 additions & 0 deletions src/tpl/stack/states/autoinstall/autoinstall/ilias-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"common" : {
"client_id" : "{{ client_id }}",
"master_password" : "{{ master_password }}",
"server_timezone" : "{{ server_timezone }}"
},
"database" : {
"user" : "{{ db_user }}",
"database" : "{{ db_name }}",
"type" : "{{ db_type }}",
"create_database" : {{ db_create }},
"password" : "{{ db_pass }}"
},
"filesystem" : {
"data_dir" : "{{ data_dir }}/"
},
"systemfolder" : {
"client" : {
"name" : "{{ client_id }}",
"description" : "ILIAS",
"institution" : "{{ contact_firstname }}"
},
"contact" : {
"firstname" : "{{ contact_firstname }}",
"lastname" : "{{ contact_lastname }}",
"email" : "{{ contact_mail }}"
}
},
"language" : {
"default_language" : "{{ language }}"
},
"http" : {
"path" : "{{ http_path }}"
},
"logging" : {
"enable" : true,
"path_to_logfile" : "{{ log_dir }}/ilias.log",
"errorlog_dir" : "{{ log_dir }}"
},
"utilities" : {
"path_to_convert" : "/usr/bin/convert",
"path_to_zip" : "/usr/bin/zip",
"path_to_unzip" : "/usr/bin/unzip"
},
"virusscanner" : {
"virusscanner" : "none"
}
}
43 changes: 43 additions & 0 deletions src/tpl/stack/states/autoinstall/autoinstall/init.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/var/ilias/data/ilias-config.json:
file.managed:
- source: salt://autoinstall/ilias-config.json
- template: jinja
- context:
client_id: ilias
master_password: ilias
server_timezone: 'Europe/Berlin'
db_user: ilias
db_name: ilias
db_type: 'innodb'
db_create: 'true'
db_pass: ilias
data_dir: /var/ilias/data
contact_firstname: 'CaT'
contact_lastname: 'Concepts and Training GmbH'
contact_mail: '[email protected]'
language: 'de'
log_dir: /var/ilias/logs
http_path: http://ilias.local
- user: www-data
- group: www-data
- mode: 640

ilias-setup:
cmd.run:
- name: "php /var/www/html/setup/setup.php install -y /var/ilias/data/ilias-config.json"

/var/www/html/:
file.directory:
- user: www-data
- group: www-data
- recurse:
- user
- group

/var/ilias/:
file.directory:
- user: www-data
- group: www-data
- recurse:
- user
- group
3 changes: 3 additions & 0 deletions src/tpl/stack/states/autoinstall/top.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
autoinstall:
'*':
- autoinstall
50 changes: 0 additions & 50 deletions src/tpl/stack/states/ilias/ilias/ilias-config.json

This file was deleted.

42 changes: 14 additions & 28 deletions src/tpl/stack/states/ilias/ilias/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -25,32 +25,18 @@ ilias_git_config:
- value: false
- repo: /var/www/html

#/var/ilias/data/ilias-config.json:
# file.managed:
# - source: salt://ilias/ilias-config.json
# - template: jinja
# - context:
# client_id: ilias
# master_password: ilias
# server_timezone: 'Europe/Berlin'
# db_user: ilias
# db_name: ilias
# db_type: 'innodb'
# db_create: 'true'
# db_pass: ilias
# data_dir: /var/ilias/data
# contact_firstname: 'CaT'
# contact_lastname: 'Concepts and Training GmbH'
# contact_mail: '[email protected]'
# language: 'de'
# log_dir: /var/ilias/logs
# http_path: http://ilias.local
# - user: www-data
# - group: www-data
# - mode: 640
/var/www/html/:
file.directory:
- user: www-data
- group: www-data
- recurse:
- user
- group

#ilias-setup:
# cmd.wait:
# - name: "php /var/www/html/setup/setup.php install -y /var/ilias/data/ilias-config.json"
# - watch:
# - cmd: ilias-composer-install
/var/ilias/:
file.directory:
- user: www-data
- group: www-data
- recurse:
- user
- group

0 comments on commit d8caba6

Please sign in to comment.