Refactor database path variables in Ansible and Terraform playbooks; add local database folder variable
This commit is contained in:
+19
-17
@@ -37,8 +37,9 @@ locals {
|
||||
}
|
||||
}
|
||||
|
||||
gitea_path = "${local.persistent_folder}/gitea"
|
||||
gitea_mysql_path = "${local.persistent_folder}/mysql.gitea"
|
||||
gitea_path = "${local.persistent_folder}/gitea"
|
||||
gitea_db_path = "${local.database_folder}/mysql.gitea"
|
||||
gitea_backup_path = "${local.persistent_folder}/backup.gitea"
|
||||
}
|
||||
|
||||
#
|
||||
@@ -79,16 +80,17 @@ resource "kubernetes_secret" "gitea_mail_credentials" {
|
||||
module "gitea_database" {
|
||||
source = "./modules/k8s_mariadb"
|
||||
|
||||
namespace = kubernetes_namespace.gitea.metadata[0].name
|
||||
app_name = "gitea"
|
||||
app_backup_folder = "gitea.backups"
|
||||
namespace = kubernetes_namespace.gitea.metadata[0].name
|
||||
app_name = "gitea"
|
||||
|
||||
app_password = var.gitea_mysql_password
|
||||
root_password = var.mysql_root_password
|
||||
|
||||
retention_days = local.local_backup_retention_days
|
||||
cron_schedule = local.gitea_sql_backup_cron_schedule
|
||||
host_storage_path = local.gitea_mysql_path
|
||||
retention_days = local.local_backup_retention_days
|
||||
cron_schedule = local.gitea_sql_backup_cron_schedule
|
||||
|
||||
database_folder = local.gitea_db_path
|
||||
backup_folder = local.gitea_backup_path
|
||||
}
|
||||
|
||||
#
|
||||
@@ -97,10 +99,8 @@ module "gitea_database" {
|
||||
module "gitea_backup" {
|
||||
source = "./modules/scw_backup_job"
|
||||
|
||||
namespace = kubernetes_namespace.gitea.metadata[0].name
|
||||
app_name = "gitea"
|
||||
app_files_folder = "gitea"
|
||||
app_backup_folder = "mysql.gitea/gitea.backups"
|
||||
namespace = kubernetes_namespace.gitea.metadata[0].name
|
||||
app_name = "gitea"
|
||||
|
||||
scaleway_organization_id = var.scaleway_organization_id
|
||||
scaleway_project_id = var.scaleway_organization_id
|
||||
@@ -108,9 +108,11 @@ module "gitea_backup" {
|
||||
secret_key = scaleway_iam_api_key.backup_app_api.secret_key
|
||||
bucket_name = scaleway_object_bucket.backup.name
|
||||
|
||||
retention_days = local.local_backup_retention_days
|
||||
cron_schedule = local.gitea_files_backup_cron_schedule
|
||||
host_storage_path = local.persistent_folder
|
||||
retention_days = local.local_backup_retention_days
|
||||
cron_schedule = local.gitea_files_backup_cron_schedule
|
||||
|
||||
source_folder = local.gitea_path
|
||||
target_folder = local.gitea_backup_path
|
||||
}
|
||||
|
||||
#
|
||||
@@ -226,7 +228,7 @@ resource "kubernetes_deployment" "gitea" {
|
||||
port = "http"
|
||||
}
|
||||
initial_delay_seconds = 200
|
||||
period_seconds = 10
|
||||
period_seconds = 300
|
||||
success_threshold = 1
|
||||
failure_threshold = 5
|
||||
}
|
||||
@@ -236,7 +238,7 @@ resource "kubernetes_deployment" "gitea" {
|
||||
port = "http"
|
||||
}
|
||||
initial_delay_seconds = 5
|
||||
period_seconds = 60
|
||||
period_seconds = 10
|
||||
success_threshold = 1
|
||||
failure_threshold = 3
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user