summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-08-07 23:39:19 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2022-08-07 23:39:19 +0200
commite9ba3cdf1a530c7fa16fe362c56474227fdf4c7d (patch)
treefb0b646f0400b83559696ca71855bfbfe879ca14
parentFix up shiori. (diff)
downloadshiori-e9ba3cdf1a530c7fa16fe362c56474227fdf4c7d.tar.gz
shiori-e9ba3cdf1a530c7fa16fe362c56474227fdf4c7d.tar.xz
Shiori Start writing support for other databases.
-rw-r--r--manifests/init.pp35
1 files changed, 34 insertions, 1 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 69d5fde..dbadf59 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -1,9 +1,14 @@
class shiori (
$port = 8080,
$dir = '/var/www/shiori',
+ Enum['sqlite', 'mysql', 'postgresql'] $database = 'sqlite',
+ Boolean $manage_db = true,
+ Optional[String] $db_pass = undef,
+ Optional[String] $db_addr = undef,
+ String $db_user = 'shiori',
+ String $db_name = 'shiori',
) {
-
# on arch this is available through the aur
package { 'shiori-bin':
ensure => installed,
@@ -43,6 +48,34 @@ class shiori (
source => 'puppet:///modules/shiori/shiori.service',
}
+ case $database {
+ 'sqlite': {
+ }
+ 'mysql': {
+ $extra_config = {
+ 'SHIORI_DBMS' => 'mysql',
+ 'SHIORI_MYSQL_USER' => '',
+ }
+ if ($manage_db) {
+ error("Can't managae MySQL")
+ }
+ }
+ 'postgresql': {
+ $extra_config = {
+ 'SHIORI_DBMS' => 'postgresql',
+ 'SHIORI_PG_USER' => '',
+ 'SHIORI_PG_PASS' => '',
+ 'SHIORI_PG_NAME' => '',
+ 'SHIORI_PG_HOST' => '',
+ 'SHIORI_PG_PORT' => '',
+ }
+ if ($manage_db) {
+ # create database
+ # create database user
+ }
+ }
+ }
+
file { '/etc/conf.d/shiori':
ensure => 'file',
content => @("EOF")